I have noticed this on an application I am working on right now, so I created a simple test app to demonstrate. Below is my a window and the event handler for the treeview items. If you expand either the "One" or "Two" parent nodes, and click one of the children, the child that was selected does not show up as selected after the Focus(...
When I place a Viewbox as the child element of a WPF window, the Cider Designer "hides" all interior controls with the text "Viewbox" only appearing on the display.
Why? Is there a problem with this layout? Are there better layouts to achieve scalable images on a canvas?
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schem...
In our scenario, we have a wpf application that is used by users over remote desktop, and we found the user experience is very slow.
Any suggestions for improving the user experience in this scenario? One point might be to disable any animation/storyboards, and avoid using gradients in the UI. More thoughts are appreciated.
...
The following code puts the two text elements at the top even though the second one is marked "Bottom". The background color goes all the way to the bottom so the DockPanel seems to stretch to the bottom.
What am I not understanding about DockPanel?
<Window x:Class="TestIndexer934.Views.MainView"
xmlns="http://schemas.microsoft.com...
I have a slider with minimum value 0 and maximum value 1.
When I currently slide it, the value gets set to a decimal value between 0 and 1, e.g. 0.2342343.
However, I want the value to only be either 0 or 1 (so that my ViewModel property will register the change only if it is 0 or 1 and not multiple times as the user drags it from 0 to...
I've run into an odd problem with attached properties where when I assign the property name in the call to RegisterAttached and name properly for the name of the attached property (say TranslateProperty and "Translate") the code for the attached property implementation doesn't fire. Just doesn't get called. If I change the string name to...
Hello,
I've placed in my MainWindow a StackPanel, which gets dynamically on runtime new UserControls (the UserControl is a row of TextBoxes and a button named "Delete").
This is about how I create the UserControls:
PersonObject p = new PersonObject;
List.Add(p);
UserControlLine usrCtrlLine = new UserControlLine();
usrCtrlLine.DataCont...
Hi,
Does anyone know if there's a free WPF syntax highlighting component? I'm currently using AvalonEdit, which is part of the new SharDevelop source.
The trouble I'm having is that it doesn't appear to support binding for the text content.
Does anyone know if this is possible or if there's any other similar controls that do support da...
In the following code example, you can move the slider from German to English and see that text block get translated at runtime, however:
only the TextBlock bound to a string gets updated
the TextBlock bound to a Dictionary does not get updated
It seems that the View simply gets the Dictionary object once and then doesn't update anym...
I am developing a WPF application using the CAG from Prism. What I want to achieve is create new instances of a module (ModuleA) and load them in a TabControl.
I am able to instantiate the modules using the moduleInfo object and loading them through the Assembly and calling the CreateModule(type) method.
I can actually see the differen...
I have a vector image that I've defined in XAML. What is the proper way to use this resource in a WPF application?
I want to have the vector image in its own XAML file, and then add the image to other UserControls in my application. What should be the top-level element in my XAML vector image? How do I refer to that image in other UserC...
How do I go about getting an ObjectDataProvider to get triggered each time a combo box is expanded instead of just one time?
<UserControl.Resources>
<ObjectDataProvider x:Key="possibleExpressionValues"
MethodName="GetWatchVariableNames"
ObjectType="{x:Type mu:UserInterfaceHelper}" IsInitialLoadEnabled...
Let's say I have a View that is bound to ViewModel A which has an observable collection Customers.
An advantage of this MVVM pattern is that I can also bind the View to ViewModel B which fills it with different data.
But what if in my View converter Converters to display my customers, e.g. I have a "ContractToCustomerConverter" that ac...
Hi, all.
I'm trying to declare a resource in a WPF UserControl, and I'd like the resource to be an instance of a private inner class. How do I do this?
XAML:
<UserControl ...>
<UserControl.Resources>
<local:MyConverter x:Key="MyConverter" />
</UserControl.Resources>
</UserControl>
Code Behind:
public partial class M...
I would like to know why according to this article and observable collection binds significantly faster(20 ms vs 1685ms, that's 800X faster) than a List<> collection in WPF. I looked at the internals of ObservableCollection and it uses a List as it's storage collection object(I used reflector and saw this in the constructor)
public Coll...
Over at the StackOverflow question How can WPF Converters be used in an MVVM pattern? I've learned that Value Converters should not be used in the MVVM pattern since the functionality of a Value Converter should be handled by the ViewModel itself.
This makes sense.
But I remember reading that you should not expose XAML elements to the ...
Here is my XAML
<Grid
Name="grid">
<TextBlock
Text="Some Label" />
<WindowsFormsHost
Name="winFormsHost">
</WindowsFormsHost>
</Grid>
On the load of the form I execute the following method
protected void OnLoad(object sender, RoutedEventArgs e)
{
// Create a line on the fly
Line line = new Lin...
Is there a way to print a WPF screen directly to a Device Context? In other words, is it possible to design a layout using WPF and then write that layout to a Device Context?
Thanks!
...
Okay, here's my situation. I have a WPF app that I have created that also includes an application protocol handler so that the app can be opened from links on the web that opens the app with command-line parameters to pre-populate some information. All this is working.
What I would like to accomplish is this. If the user already has ...
I'm trying to create a SplitButton control that uses a ContextMenu to display its items. The SplitButton is currently deriving from Button. I have a PART_DropDownInitiator that is the little icon the user clicks on to bring up the ContextMenu for the SplitButton to show its items.
The problem is that I'm trying to setup a default Contex...