I am trying to animate the line that strikes through text in a textblock.
Here is what I have so far.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<Style x:Key="TextBlockEliminated">
<Setter Property="Control.FontSize" V...
I have a stackpanel containing a stackpanel and some other items. The first stackpanel has a vertical orientation, the the inner one has a horizontal orientation. The inner one has a treeview and a listview, I would like them to expand and fit the width of the window, which I set by the window and allow the user to change. I would also l...
I want to monitor changes to a CollectionView but the CollectionChanged event is protected. How should I do this? Surely there must be a way to subscribe to this event - the list controls must do this somehow.
I can cast SourceCollection to INotifyCollectionChanged and add an event there, but that seems unneccesarily messy.
...
My non-databound TabControl looks fine:
<TabControl Width="225" Height="150">
<TabItem Header="One">
<TextBlock Margin="10" Text="This is the text block"/>
</TabItem>
<TabItem Header="Two"/>
<TabItem Header="Three"/>
<TabItem Header="Four"/>
</TabControl>
But my databound TabControl looks like this:
<W...
I am doing an application which is used to clear the Temp files, history etc, when the user log off. So how can I know if the system is going to logoff (in C#)?
...
I'm attempting to do some type resolution inside of a WPF Markup Extension using the same namespace:StaticType.Property syntax that StaticExtension uses. The extension works fine at runtime and also in the Visual Studio designer, but it fails in Expression Blend. After some debugging I figured out that the failure occurs in a call to IXa...
I have an application that allows the user to change color schemes based on an external xaml file. When the user clicks on a MenuItem that contains the name of a theme, the following code executes:
MenuItem mi = sender as MenuItem;
string executingDirectory = Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAs...
Hi,
I have a listbox whose itemssource is databound to a list of ints.
I'd like to bold bold a few of the items, on the basis of their value.
There are two options that come to (my) mind:
1) Use datatrigger that bolds the value if it's a match.
2) Use a class to wrap the ints and pair each int with a boolean that denotes if the value ...
Hi
I have a itemscontrol that displays some textboxes dependning on the observable collection items in viewmodel. I need to determine the textbox that has keyboard focus on click of a button outside the itemscontrol.
Problem:
1. When i click the button the keyboard focus shifts to button instead of the textbox.
2. How can i get the a ...
For instance I am setting the Visibility on and off for a certain element. I have a Trigger that listens to the Visibility being set to Visible and plays out a Storyboard that fades in the element.
So on the flip side, when the element is set to Hidden, I want the element to fade out, and then have the property set to Visibility = fa...
Hi, I changed the template of the ListBox. The problem is, look at the vertical Scrollbar:
http://img223.imageshack.us/img223/3391/lisbox.jpg
how to make it lie within ths rounded ListBox ?
...
I'm tracking ListView selection changes in an MVVM design by binding to IsSelected. I also need to track the current item by enabling IsSynchronizedWithCurrentItem.
I find that when I have two ListView binding to the same collection I get the InvalidOperationException: "Collection was modified; enumeration operation may not execute." ...
I've made a markup extension for translating strings based on a key. Example
<TextBlock Text="{Translate myKey}" />
Now I want to be able to use nested bindings for providing my keys. Example:
<TextBlock Text="{Translate {Binding KeyFromDataContext}}" />
When I do this I get a System.Windows.Data.Binding object. By calling ProvideV...
How do I derive a new class from DataTemplate and then use it in place of DataTemplate?
For example, in C#:
public class DerivedDataTemplate : DataTemplate
{
}
Then in XAML:
<local: DerivedDataTemplate DataType="{x:Type local:SomeType}">
<Grid>
... UI here ...
</Grid>
</local:DerivedDataTemplate>
When I try to use ...
Is there a way to get WPF to automatically apply a Converter to all bindings of a specific type?
I've seen this question, but it covers a different case (localisation) and thus has no satisfying answers.
My problem: I've got model classes containing Commands, which I would like to bind to WPF Commands. Since the model classes are toolk...
Trying to mimic the way the IPhone flips the album art to the songs list. I want to pass in two generic objects and have the storyboard flip them. I can get the slide effect, but have not figured out how to scale the object so it appears to be rotating and not just sliding.
Thanks,
Dave
...
So I have a control template that looks a bit like this
<ControlTemplate TargetType="{x:Type local:OptionCheckBox}">
<Grid>...</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Visibility" Value="Visible">
<Trigger.EnterActions>
...
Hi,
I have a simple converter that adds a "+" symbol to a positive number that is entered in a TextBox. When the number is entered I want to initiate some action, but I don't want to wait until the TextBox loses focus: I want to update the binding immediately as the user enters the text.
The default behaviour of a TextBox is that when ...
Can anyone think of a good explanation for the fact that result of a dialog is a nullable bool in WPF? This has always baffled me. In WinForms it was an enum type and that made a lot more sense to me.
...
What is currently the best solution for WPF applications which are meant to be used on one computer where various users log into them and use them to get/save information locally? Here's how I see the options:
MDF would seem to be the best choice since I assume you can lock it down quite well so that even though users can access the .m...