wpf,wpf-controls
I am building a wpf ribbon application. When certain buttons are clicked on, I would like the background to remain "lit up" like when the mouse is over it. I don't want to change the default mouseover color, I just want to replicate it when the button is pressed for...

c#,combobox,wpf-controls
I have a combox in my wpf and 2 items called: Send Receive. I want to make the combobox to show a general message(send/receive) when the WPF is loaded up at first time. I tried to apply a string to the Text property in the XAML but it didn't work:...

c#,.net,wpf,xaml,wpf-controls
I want to change the toggler of expander when I collapse and uncollapse. Which means, I want to place an image instead. Is there a simpler way to do that in XAML rather than building ypur own expander template?

c#,wpf,wpf-controls
I am using gif animation in WPF application, an external dll WpfAnimatedGif.dll is used for showing the animation. The animation is working properly, but I am unable to pause/stop it on a certain event let say button click, how can I do it, kindly guide me, my xaml code is...

c#,wpf,data-binding,wpf-controls
I have WPF control, it has a list view with many buttons I need those buttons to blink and highlight for a short time when their binded value changes (to Green when value goes up and to red when it goes down). What is the best way doing that?...

wpf,xaml,wpf-controls
When checkBox selection is done two buttons will animated i just want to do like that,that grid comes in full view i tried rowspan and columspan but not working don't know how to work with it. comes in full view my animation with connection other side of window. code...

c#,wpf,mvvm,wpf-controls
I have just started learning WPF and trying to hide a StackPanel during MouseOver. Below is the code that I use. I can only see the Panel flickering when mouse is placed on it but, it doesn't hide completely. Am I missing something here? Thanks in advance. <Style x:Key="myStyle" TargetType="{x:Type...

c#,.net,wpf,wpf-controls
I have been trying to adjust the screen based on different sizes to see if any components are reacting to that. Unfortunately they don't I am not sure what I am missing. And it would be great if anyone can give a direct advice and tips for my example implementation....

wpf,wpf-controls,wpfdatagrid
I am trying to use LostFocus event as Command in DataGridTextColumn and can't find an example on how to use it in WPF. Can anyone help me use it as I am new to WPF. Thank you. My xaml looks like: ` The c# code: public partial class Myogg :...

c#,wpf,wpf-controls,ellipse
I'm trying to draw a circle centered at point2 with radius "r". r's length should be long enough to be the distance between point1 and point2. I drew a picture to illustrate this. How can I calculate the correct width and height of the ellipse to draw it like this...

wpf,wpf-controls
How can I (programatically) set the font size of a TextBlock in a WPF Canvas? The text size should be relative to the canvas dimensions, so that it is centered. This works for my local machine, but displayed on a larger screen, the text is cut off halfway up. double...

wpf,wpf-controls,wpf-animation
I made in style a button animation. All elements of a button placed in the Grid. But if do not set background in grid, animation does not work correctly. Button: <Grid> <Rectangle Fill="{TemplateBinding Background}" RenderTransformOrigin="0.5,0.5" Margin="5"> <Rectangle.RenderTransform> <RotateTransform x:Name="RotateTransform" Angle="0"/> </Rectangle.RenderTransform> </Rectangle> </Grid> Animation: <ControlTemplate.Triggers> <EventTrigger RoutedEvent="MouseEnter"> <BeginStoryboard>...

wpf,wpf-controls,custom-controls,dependency-properties
Currently implementing a custom control I would like to bind some Value directly from my viewModel without using xaml. I can do this: <customControls:MyControl MyValue="{Binding ElementName=MyElem, Path=Text}"> <Textbox Text="{Binding Mytext}" /> But not: <customControls:MyControl MyValue="{Binding MyText}"> The controls is defined in a template and inside the Control code my the...

c#,wpf,calendar,wpf-controls
Is there a way (using a Calendar control in Visual Studio WPF) I can obtain a value without actually selecting a day within the control. For example, I have a client that wants the calendar's DisplayMode = Year. And now let's say they select the month of March within the...

wpf,wpf-controls
I am trying to create a WPF custom slider control that acts as a scrollbar for a Listview. I'm doing this by putting the name of the listview in the Tag attribute of my custom slider and then using the slider's OnValueChange event to scroll the listview. This works great,...

wpf,xaml,button,wpf-controls
I try to edit style in wpf like this : which allow the user design, like this but when i try to create my own style there is chrome layer not Template and I can not create my own button, I can only modify simple value like brush , .........

c#,button,wpf-controls,visibility
I have some button that I want them to be hidden when the wpf loads up. I use this: public MainWindow() { mySendButton.Visibility = Visibility.Hidden; myReceiveButton.Visibility = Visibility.Hidden; InitializeComponent(); } But the above generating an error. i think I wrote them not at the right place. Can I get a...

c#,wpf,wpf-controls
Is it possible to adjust the width of all TextBlocks in the WrapPanel to the size of the largest TextBlock within the WrapPanel? The end result should be that the width of the control containing "Some data" has the same width as the control containing "Even more data than before."...

c#,wpf,wpf-controls
I'm having some trouble making the progress bar show the updates in real time. This is my code right now for (int i = 0; i < 100; i++) { progressbar1.Value = i; Thread.Sleep(100); } But for some reason the progress bar shows empty when the function runs, and then...

wpf,wpf-controls,html-parsing
I start to learn WPF and there is something that is still unclear for me: I want to create app, which can get information from online web sites (e.i. news). How can I parse data from pages? And second question, which is connected first one, How can I save user...

c#,.net,wpf,wpf-controls
Goal I have a WPF window with some nested ItemsControls. I need to extract the items into bitmaps but without actually displaying the window. So far, I have gotten through some of the hurdles of rendering the visual tree without displaying the actual window. Problem My problem is that the...

wpf,wpf-controls,scrollbar,richtextbox,vertical-scrolling
I have a WPF RichTextBox in my application that sits in Grid. It gets updated every second or two as it displays logs (though sometimes there are no logs for up to a minute depending on the load). The grid is not always visible, as it sits in its own...

c#,wpf,wpf-controls
I work on WPF application and I finishing it, but I notice that when I run the application, the application Icon does no appear in Windows task bar ? Although I assigned icon for my application in application properties. Any idea ? Thanks in advance Abdusalam...

c#,wpf,wpf-controls
I have a dependency property on a class, let's call it 'SomethingControl': public static readonly DependencyProperty SomethingProperty = DependencyProperty.Register("Something", typeof(Something), typeof(SomethingControl), new UIPropertyMetadata(SomethingGotSet)); And I have defined the callback method that is being passed into the UIPropertyMetadata constructor as asynchronous: private async static void SomethingGotSet(DependencyObject d, DependencyPropertyChangedEventArgs e) { var...

wpf,wpf-controls,.net-4.5
I have a ListBox with the following ItemTemplate: <DataTemplate> <StackPanel> <TextBlock .... /> <ListBox .... /> </StackPanel> </DataTemplate> I would like to forbid the user to Select an item in a child ListBox, and that when user clicks on the child ListBox, a parent ListBox SelectedItem should be set respectively....

wpf,wpf-controls,wpfdatagrid,wpfstyle
I have DataGrid with custom style, I'm having trouble in re-sizing columns because it only works when the cursor is EXACTLY between the two columns Here's the part of style that sets the DataGridColumnHeader <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="Foreground" Value="White"/> <Setter Property="FontFamily" Value="Segoue UI"/>...

wpf,wpf-controls
I have a ScrollViewer with HorizontalScrollBarVisibility set to "Auto" that contains a TextBox. The problem is that when a user enters text, the TextBox keeps growing in order to show the entire content. What do I need to change, so that the TextBox only grabs the available width (but is...

c#,wpf,checkbox,listbox,wpf-controls
this is my user template in listbox. i want to have "listbox.selectedindex" on clicking any checkbox of listbox. i want to knw of which row,checkbox is selected.like on click event of checkbox,it should focus the whole selected row. <ListView x:Name="listbox3" Visibility="Visible" Margin="540,168,37,46" IsSynchronizedWithCurrentItem="True" BorderBrush="Black"> <ListView.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Width="200" >...

c#,wpf,xaml,data-binding,wpf-controls
I'm attempting to bind a string property to a TextBox's Text field in XAML. I am doing this in a UserControl. I've searched StackOverflow and the internet in general and found various related topics, some examples: Binding objects defined in code-behind WPF: simple TextBox data binding I've followed the code...

wpf,wpf-controls,hwndhost
Following the instructions in: How to run an application inside wpf application? and in the walkthrough in MSDN (https://msdn.microsoft.com/en-us/library/ms752055.aspx) I have managed to host my console applications in wpf. (Note: there are more than 2 applications to be hosted) In ControlHost.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using...

c#,wpf,xaml,wpf-controls
I have a textbox on a WPF app that I want to be able to drag text into from an outside application (notepad++). The PreviewDrop handler works great but when I go to retrieve the text from the text box after the handler is called (myTxtBox.Text) all I get is...

wpf,wpf-controls,.net-4.5
I have two custom ItemTemplates for the ListBox, one for the regular items, and one for the selected item. An example of how would I handle this is: <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="ContentTemplate" Value="{StaticResource Template1}" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="ContentTemplate" Value="{StaticResource Template2}" /> </Trigger> </Style.Triggers> </Style> </ListBox.ItemContainerStyle>...

wpf,f#,event-handling,wpf-controls,dependency-properties
I have tried to create a "UserControl" "By-Code" only, using F# (Vers. 12.0.30815.0 + Framework 4.5) since I prefer this "way" (no mix between C# and F#). NOTE: I have to show multiple properties of a single Class in an Input Form, so this UserControl need to implement Binding capabilities...

wpf,vb.net,xaml,wpf-controls
I am trying to bind ribbon buttons property IsEnabled to code property so I can make it available or not to the user depending on a certain situation. I don't know what I am doing wrong and I can't figure it out Currently I have the following code. The class...

c#,xaml,wpf-controls
I have a custom control inheriting from ListBox. I have a style for it targeting my custom control. For some reason this style is not working on my custom control. Could you please tell me what I am missing here? Code for style: <Style x:Key="ListBoxStyle" TargetType="local:CustomListBox"> <Setter Property="Background" Value="Red"/> <Setter...

wpf,user-interface,wpf-controls,dockpanel
I know the order of DockPanel children elements matters. I've read somewhere that layout of a child is determined based on the available space left after all previous children have already been positioned. So for example for this piece of code: <DockPanel> <Button DockPanel.Dock="Bottom" Height="20" Content="MyButton"/> <DataGrid Name="dataGrid" ItemsSource="{Binding CarList.Items}"/>...

wpf,wpf-controls
I want to add stack panel dynamically when check box is checked and if check box is unchecked then i want to remove that stack panel. I tried following code. when i run the program and check the check box nothing is happening. private void bCheckbox_Checked(object sender, RoutedEventArgs e) {...

c#,html,wpf,printing,wpf-controls
EDIT: Completely rewrote question and added bounty. Based on many tutorials and stackoverflow questions I can now: Print multiple pages together as one document. Print actual content. Align content correctly on page. Print correct size documents. The solution requires the HTML document to have some white space in the bottom...

wpf,wpf-controls
I have a Button within a GridView within a ListView. When the button is clicked, I would like to get the text from the corresponding row of the Grid View for that button. Can anyone help me with the code for this? My XAML is: <ListView Name="resultList" ItemsSource="{Binding}" DockPanel.Dock="Top"> <ListView.View>...

c#,xaml,windows-phone-8,wpf-controls
Windows Phone 8.1 I have a custom control with ContentPresenter. When this control is used in XAML page, it is possible to add any type of FrameworkElement there. I want to enumerate through all items in ContentPresenter and act accordingly to what I find there. This is my approach: protected...