xaml

Setting a style on Control type not working

I'm writing a very basic WPF dialog and want to apply a simple style to all objects that inherit from the Control class. The code I'm using: <Window.Resources> <Style TargetType="{x:Type Control}"> <Setter Property="Margin" Value="20"/> </Style> </Window.Resources> <StackPanel> <TextBlock Text="some text"/> <Tex...

"inherit" style of theme in wpf

I'm using one of the themes in CodePlex and I want to add some modifications on the style but not to change their code. How can I inherit the theme style? ...

WPF Image Gallery

I'm going to be driving a touch-screen application (not a web app) that needs to present groups of images to users. The desire is to present a 3x3 grid of images with a page forward/backward capability. They can select a few and I'll present just those images. I don't see that ListView does quite what I want (although WPF is big enoug...

XAML - How Do I Bind an Element of a Derived <UserControl> to an Element of the Base <UserControl>?

How do I bind an element of a derived <UserControl> to an element of the base <UserControl>? I have defined a UserControl called Tile as my base class. This would be an abstract base class, if XAML wouldn't balk when I tried to instantiate an object derived from it ... Anyway, so far Tile only contains a single dependency property:...

WPF TabItem problem of focus

I have a tabcontrol binded the an observable list. Eveything look to be perfect until I select a tab. Once selected, the tab doesn't lost its focus and the selected tab is not available. They are not any message in the Output Window. Here is a screen shot just before clicking the tab: And here is a screen shot after (with the problem...

WPF Spell check

Hi, I'm playing with the integrated spell check in WPF. I need to configure it dynamically from code behind, not just in XAML. XAML solution works perfectly (SpellCheck.IsEnabled=true + xml:lang attribute). However if I try to enable spell check using this code snippet, it is not working: Thread.CurrentThread.CurrentCulture = new Cul...

Why does WindowStartupLocation = CenterScreen place my window somewhere other than the center of the screen?

Here's the Window declaration: <Window x:Class="Pse.ExperimentBase.SplashWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Style="{StaticResource _windowStyle}" WindowStartupLocation="CenterScreen" WindowStyle="None"> Here's the Styl...

How to change x,y origin of canvas to bottom left and flip the y coordinates?

I have a bunch of data points that I would like to two-way bind to points on a canvas. The points assume larger y values are reflected in an upwards direction like most math graphs. How do I change the x,y origin of the canvas to the bottom left corner and reverse it's interpretation of the y coordinate? (I would like to stay in XAML)...

Creating bitmap image using xaml information

Hello, I want to draw Bitmap image using the xaml. Could some one please help me out in this regards as I am very new to XAML? Thanks in Advance, Ravi Naik. ...

store bitmap image in Xaml..

I need to store the bitmap image information in Xaml formated file. Can any one pls help me out on this regard? Thanks in advance. Ravi Naik ...

How to assign a dynamic imagebrush resource to a stackpanel's background in code?

I currently define the background for a user control like this: <UserControl.Background> <ImageBrush ImageSource="{DynamicResource LeftMenuBackgroundImage}" /> </UserControl.Background> How can I move this to code-behind, e.g.: PSEUDO-CODE: StackPanel sp = new StackPanel(); sp.Background = new ImageBrush(DynamicResource.GetResou...

WPF - Confusion with namespaces and "odd" errors

I've been trying to get my head around XAML and it's namespaces and I just cannot seem to get the logics of things. For example, I'm trying to animate a gridrow's GridLength property following a tutorial. I can get the sample code to run just fine. But trying to actually port the features into my own code seems to be impossible. I always...

Is there a way to ignore Visual Studio errors thrown by XAML?

I know you can do it in CodeBehind with something like this... #pragma warning disable 67 ... #pragma warning restore 67 But is there a way to do this type of thing in XAML? For example, I have the following in my App.xaml... <FontFamily x:Key="ExtendedFontFamily">Verdana</FontFamily> And it keeps throwing me these VS errors (even...

Button: Binding different DelegateCommands depending on the ClickMode value (Press / Release)

Hey atAll! Often found answers here, but now it`s my first time ;) We use the MVVM pattern in conjunction with DelegateCommands. So normally I bind a command to the button like this: <Button Command="{Binding SetXYZActivatedCommand}" /> I need to execute different commands when the button is pressed and when the button is released a...

Displaying a progress bar & text in a cell of a data grid (XAML)?

How can I display an animated progress bar within the contents of a cell of a datagrid, with text in the foreground. For instance, I want to display "Uploading..." and have the progress animated behind it. ...

What is the best way to display a grid of a large number of items in Silverlight?

I am currently working on a Silverlight2-based attendance register. I want to create a visualisation of attendance over time for students and classes, but am struggling to come up with a good way of doing it. The sort of thing I'm imagining is a grid with students on the vertical axis and date along the horizontal, with a symbol at the i...

Silverlight loads image from URL, but it doesn't display

Behold the following XAML: <Grid> <HyperlinkButton x:Name="Link" Background="Green"> <Grid Background="Red"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="12" /> </Grid.RowDefiniti...

How can I set the minimum size of a expander control in WPF ?

How can I set expander to show some content it encloses even in collapsed state ? I have the following code snippet, can anyone point changes to this code ? <Window x:Class="UI2.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="358" W...

How to achieve databinding with an user control in wpf?

Hi! I'm fairly new to WPF and I have some problems getting databinding to work as I want. I've written a user control which contains a TextBox whose Text-Property I want to bind to a property of my UserControl, which I want to bind again to something else. What am I missing? XAML <!-- User Control --> <TextBox Text="{Binding Path=The...

Howto RadioButtons and MVVM pattern

I'm using PRISM (and thus the MVVM pattern). I've got a complex DateTime picker view with radio buttons. The user can pick today, yesterday, a date, a week of a year, etc. I use radio buttons for the different choices. What's the best way to do that in MVVM? I really can't think of a clean way. I could create lots of custom behaviors ...