xaml

Check if a ObservableCollection, and if so display an alternative xaml!

I have a ListView with a binding to a ObservableCollection. Further I am listing out all items in the ObservableCollection. Now, Is there a good way to check if the ObservableCollection is empty, and the display an alternative xaml? ...

Link to external texture file in self-contained XAML representing a 3D model.

I have a XAML file representing a 3D model with textures. I want to make the textures read from the same place the file is, or relative to it. I read the file using a XamlReader, so I want the file to be self-contained. I place the textures using an ImageBrush which ImageSource is a pack synatx URI. When I use a 'siteoforigin' syntax...

Is it possible to bind to a lambda expression in Silverlight?

I have a listbox that simply binds to a collection. The collection has a child collection (StepDatas). I would like to bind to a count of the child collection but with a WHERE statement. I can bind to ChildCollection.Count but get lost when needing to add the lambda expression. Here's the XAML: <ListBox Height="Auto" Style="{StaticR...

Bind to ItemsControl's DataContext from inside an ItemTemplate

I have an ItemsControl whose for the ItemTemplate DataTemplate contains a Button. I want the Command on the button to bind to a Command on the DataContext of the ItemsControl, not the ItemTemplate. I think the solution has to do with using RelativeSource, but my attempts so far have failed: <ItemsControl ItemsSource="{Binding Games}"> ...

possible to default-disable XAML designer in VS 2008?

A lot of my XAML pages were designed by hand and don't need to be shown in the designer when I open them-- I'd prefer just the XAML page. The designer is getting in the way most times. Is it possible to have the designer disabled by default, with the "resume loading the designer" link available in case I change my mind? ...

MouseEnter event not fired during an animation

I have a red border moved by an animation (with a RenderTransform) and the blue border underneath is handling the MouseEnter event. Unfortunately, the MouseEnter is not fired when the mouse enters the blue border (because the red border has moved away) but when the mouse is moved. The sample below is tested in Silverlight but I believe...

Modify XAML string dynamically

Hi, I want to add/remove some part of XAML dynamically i.e. from code behind file in C#.how to Add any specific XAML string on specified location (means under some tag) from .cs file. Please help. ...

How to bind Window background to a theme's Window background color?

How can I bind the default Window background color of the theme to a Window background? I've tried the following: <Window x:Class="Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Shell" Height="300" Width="300" Background="...

How to bind GradientStop Colours or GradientStops Property in Silverlight?

I want to be able to have a dynamic Gradient in Silverlight, such as below: <RadialGradientBrush GradientOrigin="0.20,0.5" Center="0.25,0.50" RadiusX="0.75" RadiusY="0.5"> <GradientStop Color="{Binding Path=GradientStart}" Offset="0" /> <GradientStop Color="{Binding Path=GradientEnd}" Offset="1" /> </RadialGrad...

how to create email link in xaml

how to create an email link in xaml? Thanks ...

What are must-have third party XAML Controls

As I get myself ready to move my Winform applications to XAML, I was wondering what are the must-have third party XAML controls that will save me developing time and will make my app look shiny with little work? Thanks, Nestor ...

Setter.Value instead of Setter in Silverlight

I know I can write a Setter in Silverlight like this: <Setter Property="Background" Value="{StaticResource MyBrush}" /> However, due to other considerations, I have to write the setter in the format: <Setter Property="Background"> <Setter.Value> ????? static resource </Setter.Value> </Setter> Any examples I've seen have t...

display an animation gif in WPF

I would like to display an animation gif such as loading... in my XAML as my procedure is progressing. I found out that this cannot be easily done in WPF as I loaded my Gif and it just shows the first frame. What are the best ways to display an animation in WPF. ...

How to instantiate DataContext object in XAML

I want to be able to create an instance of the DataContext object for my WPF StartupUri window in XAML, as opposed to creating it code and then setting the DataContext property programmaticly. The main reason is I don't need to access the object created externally and I don't want to have to write code behind just for setting the data c...

TreeView.ItemContainerGenerator.ContainerFromItem returns null for nonroot items. Workaround?

In the following sample, when I select "String", the title of the window turns to "null". But I must obtain the container of "String". Specifically, I want to do the equivalent of SelectedItem = null (but that property is read only for TreeView, so I'm trying to get to the container to set its IsSelected to false). What to do? <Window x...

Deploying xbap in a full trust mode

I have xbap which needs to run on a full trust mode because my application needs to upload a file from the client machine to process. I have to provide a installation steps to install. If i do it as a click one instillation, do i still get a security error? If so what is the best way to resolve it? If i install it in remote server, I sa...

wpf xaml namespace refactoring

Consider a ViewModel and an View that uses it, where the DataContext is set to the VM in the code behind file. When they are both at the project namespace, the view runs without exceptions with binding statements along the lines of: ItemsSource="{Binding Path=PrefixFilterChoices}" where PrefixFilterChoices is a property on the VM. W...

how can i change controls when a button is pressed in xaml

i am trying to create a wpf app and have different parts in user controls. in the navigation i have some buttons (now using the ribbon ctp). is it possible to change the main user control when different buttons are pressed in xaml. or is this just a bad way to do things? sorry, really new to xaml and im trying to get my head arround it...

How can I extend this dependency property example to recreate a DockPanel.Dock="Top"-like dependency property?

I'm trying to get a better understanding of what dependency properties and what they are not. I've built the example below which enables a combobox's choices to change based on how the user moves a slider. In creating this I learned that dependency properties actually have nothing to do with INotifyPropertyChanged as is used in ViewMode...

I've created an Attached Property, now how do I use it?

I'm trying to determine if Attached Behaviors are something we need in building controls for the forms in our application. Hence, I not only want to know how to create Attached Behaviors but want to see real instances in which they are used to solve problems. I used this MSDN article to create a UserControl with an attached property in ...