I've seen a few articles on unit testing view models in MVVM and how the tests themselves are consumers of the view models, testing the functionality of the viewModel and model. However, I'm left wondering how I go about testing the views (UI) to ensure they are wired up to my view models properly. I don't want to write a test that, fo...
I have a Scrollviewer inside a TabControl, and for some reason when you change tabs my ScrollViewer jumps to HorizontalOffset of 12. My ScrollViewer, among other things has a ListView inside it with an unrestricted height. It's a strange layout, but everything inside the scroller had to be printable so I couldn't easily allow the ListV...
If I have 2 buttons, A and B, is it possible to create a style and trigger such that when the user hovers over button B, it will cause button A's style to change? I've tried using SourceName and TargetName, and am getting compiler errors. Here's the XAML that I'm fooling around with - I'd like to cause button A's content to be bolded w...
<Button x:Name="StartButton" Style="{DynamicResource StartTimerButton}"
Width="30.75" Margin="10,0.25,6,0" ToolTip="Start Timer"
Command="{Binding ExecuteStartStopWatch}" VerticleAlignment="Center" />
<Button x:Name="PauseButton" Visibility="Collapsed"
Style="{DynamicResource StartTimerButton}" Width="30.75"
Margin="10,...
I am trying to make play/pause button.
When the Play button is clicked, it will bind to the StartStopWatch command.
The play button will then change to a pause button which will bind to the PauseStopWatch command.
My problem is. I don't know how to keep the style it has and change them interchangablly. Currently I have two different butt...
I have created a WPF app where I dynamicly build XAML elements using c# code and then add them to a root "container" grid.
What I'm trying to do is take advantage of the features in Blend and create some XAML Pages that have their own set of code behind logic, Storyboards, etc.
I want to load that XAML at runtime, however for some rea...
I have an external style resource in a resource dictionary I'm referencing with x:Key. It has an x:TargetType specifying a target (TextBlock). Is it possible to apply this to a control containing a TextBlock and have all TextBlock elements within that control have the style applied?
Thanks,
Robert
...
Hi everyone,
I've got a scenario where I have a GroupBox which has a bit of content in it. I'm looking to add ContextMenu to that GroupBox and have that menu shown when the user right-clicks anywhere in the box.
The problem I have is that the context menu only appears when the border or the header of the group box is clicked. If you cl...
Given xml that looks like this:
<Root>
<Fruittree name="Apple" ID="2">
<Branch name="West" ID="1">
<Fruit name="Foo">
<Fruit name="Bar">
</Branch>
</Fruittree>
<!-- more fruitrees etc... -->
</Root>
Using xaml with a XmlDataProvider and a DataTemplate, I want to display a list, perhaps in a listbox:
...
I would like to set the Culture of a WPF application to a specific one based on user preferences.
I can do this for the current thread via Thread.CurrentThread.Current(UI)Culture, but is there any way to do this globally for the application (so it affects all threads by default)?
...
Hi,
I am using a WPF Popup, but it popups up above every single window on my desktop, even when my application is minimized. How can I make it stay only on the window it originated? The same thing happens when my window is behind other windows: the popup displays above them all.
"There must be something can be done!"
Thanks.
...
I'm looking to accept digits and the decimal point, but no sign.
I've looked at samples using the NumericUpDown control for WinForms, and this sample of a NumericUpDown custom control from Microsoft. But so far it seems like NumericUpDown (supported by WPF or not) is not going to provide the functionality that I want. The way my app i...
Dear All
Does anybody invent a workable converter program that can convert XHTML file to FlowDocument xml file?
I need this because my XHTML document have nested tag and it make my converter xslt thrown exceptions.
any ideas?
I appericate all replys and your times.
Best regards
-Ariso
...
I am converting Html to Xaml(FlowDocument to be exact) and use XamlReader to parse the newly created FlowDocument. I then insert my new FlowDocument into the RichTextBox, but none of my Application level Styles get applied to the FLowDocument elements such as the Hyperlinks.
An example of one of my styles:
<Style TargetType="{x:Type...
I just converted all my settings from AppSettings to ConfigurationSections. It definitely cleaned things up, but I'm having difficulties with the preferences window. I want to use bindings in my WPF window.
Should I store each of the ConfigurationSections in a dependency property and bind to the ConfigurationSection's properties?
Sh...
I am attempting to write a simple WPF learning project which creates a set of buttons inside a resizeable main window. There is to be one Button per entry in a collection, and the contents of that collection may vary during run-time. I want the buttons to fill the entire window (e.g. 1 button @ 100% width, 2 buttons @ 50% width, 3 butt...
Hi,
How to display treeview inside a list view, actually this listview has headers namely workbook, description,date, so when I display the tree view inside the listview, the treeview should open as per the listview headers.
My question is :
1. How to insert treeview inside Listview and my xaml code is
<ScrollViewer VerticalScrollBar...
Hi. i'm new to wpf and xaml. i find solutions of most of the problems (in other languages) by searching here n there or googling around but this one made me crazy. i searched a lot on google and browsed many forums, but it seems that this time i met with a real challenge!
I have following code in Window.Resources:
<my:NameConverter x:K...
<Button Name="btnFoo" Content="Foo" >
<Button.ContextMenu Placement="Bottom" PlacementTarget="btnFoo">
<MenuItem Header="Bar" />
</Button.ContextMenu>
</Button>
gives me a runtime error 'UIElement' type does not have a public TypeConverter class
I also tried
<Button Name="btnFoo" Content="Foo" >
<Button.ContextMen...
Is there a way to set the initial value of a databound combo box in XAML?
Here is my combo box:
<ComboBox
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Source={StaticResource NHibernateTypes}}"
SelectedValue="{Binding ElementName=IdentifierPoperty, Path=PropertyType}"
HorizontalAlignment="Stretch"
Ve...