controltemplates

Scrolling list items in wpf

為{幸葍}努か 提交于 2019-12-25 04:29:22
问题 I guess the following picture depicts the problem better than texts... alt text http://img179.imageshack.us/img179/8949/samplescrollingitems.png That is what I need. <ListBox x:Name="NamesListBox" ItemsSource="{Binding}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel x:Name="ItemWrapPanel"> <WrapPanel.RenderTransform> <TranslateTransform x:Name="ItemWrapPanelTransformation" X="0" /> </WrapPanel.RenderTransform> <WrapPanel.Triggers> <EventTrigger RoutedEvent="WrapPanel.Loaded">

Expander button on the right side: how to do it?

末鹿安然 提交于 2019-12-18 04:07:09
问题 i want to position the Expander button on the right side of the label. How to do this? 回答1: You can also set the FlowDirection to RightToLeft , but that may cause other problems. For example it also changes the flow direction for the content of the expander so you may need to set it back. <Expander FlowDirection="RightToLeft"> <StackPanel FlowDirection="LeftToRight"> </StackPanel> </Expander> 回答2: You must restyle the control's template. Here's an example: http://patconroy.wordpress.com/2008

WPF Styles/Template inheritance

社会主义新天地 提交于 2019-12-18 02:54:11
问题 I'm trying to learn WPF at the moment, and looking into making the default .Net control look different through the use of style. Using C# as my preferred language although all the code below is WPF markup. I setup gmail today with the new theme, (see image below) and thus set my self the challenge, could be done in WPF. What I have managed to achieve is to create the middle button Spam through the use of a style with a control template and triggers. The right and left buttons are very similar

adjust border on one specific side

走远了吗. 提交于 2019-12-10 00:37:58
问题 I'm using a controlTemplate of the ListBox to show a collection. I want to display all the items with a border like in a grid (all lines same size). When I give every listBoxItem a border, the line between 2 items has a double size. (made from the bottom border of the first item, and the top border of the second item) So the question is: Can I set/hide the border on a single side of an item? (like 'border-top' in css) 回答1: The border property is a thickness, just like margin and padding, so

ASP/C# code behind can not reach control from markup

时光怂恿深爱的人放手 提交于 2019-12-07 03:11:58
问题 Issue: I have a markup like this (only the important lines): <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RTDeluxe.ascx.cs" Inherits="MainSolution.CONTROLTEMPLATES.Kunde.RTDeluxe" %> <ul id="linkUl" class="teaserLinksUL" runat="server"/> The code-behind: namespace MainSolution.CONTROLTEMPLATES.Kunde public partial class RTDeluxe : UserControl { protected void Page_Load(object sender, EventArgs e) { linkUl.InnerHtml = string.Empty; } } I can access the ul inside the code-behind

adjust border on one specific side

余生颓废 提交于 2019-12-04 23:44:08
I'm using a controlTemplate of the ListBox to show a collection. I want to display all the items with a border like in a grid (all lines same size). When I give every listBoxItem a border, the line between 2 items has a double size. (made from the bottom border of the first item, and the top border of the second item) So the question is: Can I set/hide the border on a single side of an item? (like 'border-top' in css) The border property is a thickness, just like margin and padding, so you can do Border="2,0,2,2" to get a border of 2 everywhere except the top. 来源: https://stackoverflow.com

Styling a WPF layout grid background (of each cell, row, column)

蓝咒 提交于 2019-12-03 01:43:20
问题 I would like to know if there is any way to style a WPF layout grid's cells, rows and columns. I've been trying to find any information and the few mentions I've found have not been that informative. I would like to style the grid to look like the one in the linked screenshot. If the actual control does not support it, can I inherit it somehow and do it then? I am quite new to WPF so any help would be very appreciated. One other thing, I know I can style each and every control within the grid

Styling a WPF layout grid background (of each cell, row, column)

∥☆過路亽.° 提交于 2019-12-02 15:13:30
I would like to know if there is any way to style a WPF layout grid's cells, rows and columns. I've been trying to find any information and the few mentions I've found have not been that informative. I would like to style the grid to look like the one in the linked screenshot. If the actual control does not support it, can I inherit it somehow and do it then? I am quite new to WPF so any help would be very appreciated. One other thing, I know I can style each and every control within the grid, but it seems like overkill. I would like to have a grid that does it itself. screenshot http://img21

Expander button on the right side: how to do it?

安稳与你 提交于 2019-11-29 04:08:21
i want to position the Expander button on the right side of the label. How to do this? You can also set the FlowDirection to RightToLeft , but that may cause other problems. For example it also changes the flow direction for the content of the expander so you may need to set it back. <Expander FlowDirection="RightToLeft"> <StackPanel FlowDirection="LeftToRight"> </StackPanel> </Expander> You must restyle the control's template. Here's an example: http://patconroy.wordpress.com/2008/12/18/restyling-the-wpf-expander-control/ Another way to approach this is to position the expander where you like

WPF Styles/Template inheritance

谁说胖子不能爱 提交于 2019-11-29 00:12:53
I'm trying to learn WPF at the moment, and looking into making the default .Net control look different through the use of style. Using C# as my preferred language although all the code below is WPF markup. I setup gmail today with the new theme, (see image below) and thus set my self the challenge, could be done in WPF. What I have managed to achieve is to create the middle button Spam through the use of a style with a control template and triggers. The right and left buttons are very similar but with only 2 differences. They have a corner radius of 1 and margin of 15 on the left or right