In WPF application I use Textbox with custom style in which ContextMenu is overriden like this:
<Style TargetType="{x:Type TextBox}">
<Setter Property="ContextMenu">
<ContextMenu>
<MenuItem Header="Copy"/>
</ContextMenu>
</Setter>
</Style>
This works perfectly until I'll run window with TextBox in diffe...
Hi all,
I want to learn “WPF using C#” properly.
I read basic concept of WPF using C# language. Since I know C++ and HTML It did not took too much time to read C# and XAML simple tutorial.
Now when I searched for the WPF tutorial, most of the sites give WPF features and some of the .net controls API and class usage.
But I want a boo...
Is there any way to disable all controls inside a container - grid for example?
Thank you!
UPD: Although WPF’s Grid has IsEnabled property, there is definitely no IsEnabled property for Windows phone 7 Grid.
...
Hello, I don't have much experience with programming. I am working (to learn) on a project. I am using C# 4.0 and WPF 4 with EF (SQLite). I am having problemw with LINQ.
Here is the code in question (I hope this is enough, let me know if more is needed)
private void cboSelectCompany_SelectionChanged(object sender, Selection...
Considering the code below:
xmlns:interactivity="clr-namespace:Microsoft.Expression.Interactivity;assembly=Microsoft.Expression.Interactivity"
...
<ToggleButton IsChecked="{Binding Path=IsGlobalControllerAttached}" Command="{Binding Path=AttachDetachGlobalControllerAction}" ToolTip="{Binding Path=GlobalControllerToolTip}" Visibility...
I have a project containing a xaml ResourceDictionary that I wish to use outside of a FrameworkElement. The resource dictionary will contain a DataTemplate for a class local to the project to avoid polluting the app.xaml (as the project is a prism module, and will not always be present depending on config).
So, I have a test.xaml file w...
Is it possible with an animation to change the Ellipse.Fill from a LinearGradientBrush to a SolidColorBrush or change the gradientStops within the LinearGradientBrush?
...
The way I created KeyBinding is something like
<KeyBinding Modifiers="Ctrl" Key="S" Command="{Binding SaveCommand}" />
but what if I needed 2 modifier keys? eg. Ctrl+Shift
...
How would I go about changing a TabItem color from it's unselected color to it's selected color with an animation on SelectionChanged, so that both the unselected and selected TabItems change?
Edit: This is how my CustomTemplate looks like. There is no animation happening at all so what have I done wrong?
<Style TargetType="TabItem">
...
This is weird. I have a UserControl (MyControl) with a button inside. I have added a command to this button whose command target is another user control which is again added to the same window.
When I add the UserControl statically in xaml to the CustomControl's host space, the CommandBinding system works fine, where as the same doesn't...
I am creating a Text Editor Type app. I can have multiple editors open via tabs. In my first try, I used simple TextBoxes to edit text. Everything worked ok. Then I created a UserControl encapsulating the text box + buttons to perform text manipulation eg. bold/italic etc. I found out that when I open different tabs, they all contain the...
Hello!!
How can I get access to an element (TextBlock) within the DataTemplate of GridViewColumnHeader from the code????
I want to set focus on the column header.
...
Hello EveryOne I am using WPF and I made some customecontrol just like a treeview, but this is
the listtreeview so I am loading my all data into this treeview so it will take a much of time.
so I am worry about how to implement threading to improve the perfomance...
its urgent if u guys tell me.
Thanks..
...
What is/are the main disadvantage of VirtualizingStackPanel? If it doesn't have any, then why it is not made as a default panel behavior/template in ItemsControl?
...
I have a simple data structure (the properties are of course Dependency Properties):
class MenuData{
public string Header {get; protected set;}
public ObservableCollection<MenuData> Items { get; protected set; }
}
ObservableCollection<MenuData> Menus {get; protected set;}
I want to bind the Menus property as Menu element Item...
The example of this would be:
A textBox is bound to some data. There is a second text box which is not bind to anything. So I want to bind text box 2 to the same data 1st textBox is bound.
In other words I wan't to know if the DependencyObject stores some reference to it's data-bindings? If not, what is the way to find out all data-bin...
I'm mew to WPF and I really like MDI applications.
It allows me to move quickly between windows and compare the content of different windows. Furthermore, sometime the content of one window is useful for another so I can copy and paste.
I think it's a great user experience for working mode.
Right or wrong practice, I love it.
I saw
ht...
In general, what are the best practices to debug a Silverlight or WPF application, especially when you get errors with Databinding? Are there free tools available? I am not getting any errors as such, but I am interested in figuring out the approaches that you take as Silverlight and WPF experts.
Thanks!
...
I have an ItemsControl that has a fairly complex ItemTemplate which allows the user to edit an Order. Unfortunately the design surface in Visual Studio does not show the ItemTemplate so I don't get an instant feedback of the changes I make. Is there a way to visualize the ItemTemplate in Visual Studio? Here's the structure of my control:...