I have a resource (myPoint) defined in XAML as follows:
<Path Name="myPath">
<Path.Resources>
<Point x:Key="myPoint" X="200" Y="200"/>
</Path.Resources>
</Path>
In the OnApplyTemplate override in the corresponding C# code, I use the following to get a reference to this resource.
myPointReference = (Point)myPath.FindResour...
In our product, we use MVVM model first approach and it works nicely but with one caveat. When view becomes complex it takes time to create it from the data template. If the view is shown and hidden frequently, it becomes slightly irritating. If using view first, it would be easy enough to cache a view if needed - but when using DataTemp...
I've looked at a few solutions but nothing has worked yet for me.
I'm using MVVM for this project and have a ListView that I can't set the SelectedItem property.
If this is my (simplified) XAML.
<ListView Name="uxPackageGroups" ItemsSource="{Binding Path=PackageGroups, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" BorderThicknes...
I'm having some trouble coming up with a xaml page that would bind to a keyboard layout displayed on a page. Originally I have an ObservableCollection of rows that contain a KeyboardKey datatypes that specify the width of a button. The collection is bound to a listbox in the xaml. The problem I'm having is that on some keyboards the t...
I want to try something different, and am attempting to display an overlay on top of my current WPF GUI that allows the user to still interact with the GUI, but provides a layer of annoyance to let them know that something's up.
My question is really two separate questions:
1. How would you do the overlay?
My first attempt was to use...
I would like to the user to add photos at runtime, then use these images on buttons and when the button is pressed the image opens in a viewbox. how can i add these photos to the buttons?
...
I'm running a MediaElement using MediaTimeline and MediaClock. However, when I change the RepeatBehavior after it's started it has no effect, I.e. When set to RepeatBehavior.Forever and Begin(), changing to RepeatBehavior(1) has no effect - the timeline continues forever. Likewise if the timeline is set to RepeatBehavior(1) changing it t...
It is a simple task in another grid, but I can't make it happen in WPF DataGrid. There are UnselectAll or UnselectAllCells methods, but don't work. Also, setting SelectedItem = null or SelectedIndex = -1 don't work either.
There is a post here about completely disable selection, but that's not what I want. I just want to clear the curre...
I want to get the header of a selected tab-item of a tab-control and activate another tab-item of another tab-control appropriately, eg. select tab "A"/"B" of tab-control TC1 will activate tab "A"/"B" on tab-control TC2.
I want "A", "B", ... to be a enum value so that no string comparation is used. So, how can I use an enum value to se...
What is the benefit of keeping code behind 'clean'?
Many times I come across posts here about someone trying to do the equivalent in XAML instead of code behind. Their only reason being they want to keep their code behind 'clean'. Correct me if I am wrong, but is not the case that:
XAML is compiled too - into BAML - then at runtime h...
I have a control, on that control is a command called SaveToClipboardCommand. I want to bind a context menu item command to that command so that when i click it, the copy to clipboard command is executed.
<Control x:Name="Control">
<Control.ContextMenu>
<ContextMenu>
<MenuItem Command={"Bind to SaveToClipboardCom...
Binding to a Dependency Property is easy in code-behind. You just create a new System.Windows.Data.Binding object, and then call the target dependency object's SetBinding method.
But how do you do this when the property which we're binding is a CLR property and you can't provide a DependencyProperty argument to SetBinding?
EDIT: The ob...
As you may know, we can declare a string "variable" using resource:
<sys:String x:Key="someKey">someValue</sys:String>
I want to replace someValue by a binding property, how can I do it?
...
Hi,
I am displaying images inside the list box. Binding the source of the image control using object through datacontext of the listbox.
Problem: I want to display No image (Image) if the url does't have image. Is it possible do it in the xaml code.
Code:
<ListBox ClipToBounds="False" x:Name="lbBestSellerImage" Width="Auto"
Ite...
I've bound a TextBox to a Decimal. My problem ist, the Binding is using american numerical standards, using a dot for decimals separation ("1.5")
My system is german and configured to use a colon as decimals separation ("1,5").
I need the TextBox binding to show and use a colon instead of a dot to separate decimals.
How do I get the b...
Hi.
i know some Mvvm Frameworks that introduced in this thread
please describe or give me link for that what are them useful for?
not information about MVVM about MVVM Framework.
thanks :)
i want to know :
What Is MVVM Framework?
...
I bind a TextBox`s Brush Property to an IsValid Dependency Property in a UserControl with a BoolToBrushConverter. My IsValid would need 4 states because I need 4 different brushes to return from the converter. Is there another way using strings? instead of bool, could that work?
...
I'm trying to display a context menu where the user clicks the mouse in a WPF application. I've handled the OpenContextMenu event and the handler has a pair of doubles, e.CursorLeft and e.CursorTop which are the coordinates of the mouse click relative to the control that was clicked (in this case a DataGridCell). If I display the context...
I have a dynamic set of columns and when I populate the rows and know only the columnname of the rows. Is that possible to do?
A list of columns:
Columns[0] = "firstcol";
Columns[12] = "anothercol";
And a list of rows.
First row
Rows[0][0] = "item";
Rows[0][12] = "item";
Second row
Rows[1][0] = "item";
Rows[1][12] = "item";
I need ...
Hi, I am starting to work in WPF and I have found that animation is slow and jerky on my PC. I am running Windows XP Pro SP3 and have the latest gpu drivers (Quadro FX 1800), direct x 9 build and .net 3.5 versions.
I am at a loss as to whats going on as there are two other identical PCs in the office, one of which has the same problems ...