xaml

How to bind Popup's (or ContextMenu's) PlacementTarget to an element within UserControl?

In a scenario like this: <Grid> ... <local:MyControl x:Name="MyCtl" Grid.Row="1"/> <Popup PlacementTarget="{Binding ???}"/> <Grid> I need to bind PlacementTarget to a button named MyBtn within MyCtl. What is a cleanest way to do it? ...

Putting a ContentControl *inside* a WPF DataTemplate?

I have a custom Expander control called SpecialExpander. It is basically just a standard Expander with a fancy header and a couple properties (HeaderText and IsMarkedRead). I began by creating a simple class: public class SpecialExpander : Expander { public string HeaderText { get; set; } public bool IsMarkedRead { get; set; } ...

How to express a List of Dictionaries in XAML?

I want to define a List<Dictionary<string,string>> in <Window.Resources> the XAML way, so I can bind to it later. ...

Telerik Radgrid WPF

Hi, My WPF page has a RadGrid control provided by Telerik. The Grid is a nested grid which essentially means that clicking on the (+) sign on the leftmost column of the row expands the row into a Subgrid. This is being done by specifying a hierarchical grid in my XAML. Everything works just fine when you click on the row and expand the ...

Custom ComboBox control inside other custom ComboBox control, how to bind Items?

I created two custom ComboBox controls, both inherit from the default ComboBox control. public BlueComboBox : ComboBox {} public WhiteComboBox : ComboBox {} BlueComboBox contains a template and is styled properly and works perfectly. WhiteComboBox is a bit more complex. It contains a template consisting of a TextBlock and a BlueComboB...

Reuse Button Content in XAML

I have button Content that I want to use in multiple buttons on a UserControl in my Silverlight application. Here is the code for one button: <Grid x:Name="LayoutRoot" Background="White"> <Button Grid.Column="1" IsEnabled="{Binding PrivilegeChanged}" Height="24" Width="24"> <Button.Content> <Canvas xmlns="http:...

XamlParseException using Silverlight Toolkit control in Expression Blend

I am having a strange issue opening up my UserControl in Expression Blend when using a Silverlight Toolkit control. My UserControl uses the toolkit's ListBoxDragDropTarget as follows: <controlsToolkit:ListBoxDragDropTarget mswindows:DragDrop.AllowDrop="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> ...

How do I specify Command on Button when I'm using a Template in WPF?

I have a Button template to define what my edit button should look like: <ControlTemplate x:Key="EditButton" TargetType="{x:Type Button}"> <Button Style="{StaticResource GrayOutButtonStyle}" > <Image x:Name="editImage" Source="{StaticResource EditIcon}" /> </Button> </ControlTemplate> I want to declare the Command in...

Converting Xaml Paths to AI or an open standard vector path

I have a xaml path that needs to be converted to AI or some other form of vector graphics such as a fireworks format where the paths can be edited. This is the xaml: <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Layer_1" Width="80" Height="50" Ca...

Silverlight custom class & Name attribute

Just sample of behavior: namespace XAMLParserBug { public class MyCustomClass { public int ID { get; set; } public string Name { get; set; } } } then use it in XAML: <UserControl x:Class="XAMLParserBug.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.mic...

Changing focus in xaml

Greetings, I have a problem changing the focus to some button on xaml. The code I am attemps to do it looks as follows (if some conditions are fulfilled then the focus should be set to the button. The strange is that for test purposes I'm also chaning the background of the button and this property is set each time the conditions are fu...

How to forward value converter and converter argument from template parent?

I created a custom control called RegexTextBox which derives from TextBox. To this I added a Regex dependency property. All of this works fine. Next thing I created a NumericUpDown button control based upon the NumericUpDown in Kevin's WPF Bag-o-Tricks. I replaced the default TextBox with my RegexTextBox and added 3 more dependency prop...

Disable tabstop between columns in a WPF datagrid

I have a WPF Toolkit datagrid with mulitple columns. I am trying to get a behaviour where you can tab into the grid using tab, then tab out again using a single tab. E.g. I do not want to tab through all the columns or cells of the grid, just once in, and once out. Is there a simple solution, I have tried setting the TabNavigation to On...

Is there a list of Attribute classes that can be applied to a DependencyProperty?

I'm working on a problem that seems like it might be solved by applying an Attribute to the DependencyProperty. I got curious and I can't find documentation that lists all the XXXAttribute classes that apply to DependencyProperties and what the attributes are used for. Does anyone know of anything like that? If not, maybe post some at...

WPF/XAML: How do I size a window with no border?

I am using a window with no border and drawing the Chrome myself. I want to resize the window in a typical manner and have defined a 3x3 grid with the center being the content and the outer cells constituting the respective areas requiring different treatment (TopLeft/TopMiddle/TopRight... etc.) such as cursors. Maximize, Minimize, Mov...

How to create an overlay for each item in an ItemsControl?

I'm trying to decorate an ItemsControl so that each item will have a Delete button that floats over the item's content under a specific condition inspired by somewhat by the iPhone UI. I have a few ways in mind of how I can approach this but I could use some guidance from other WPF folks who might have a better idea about how this would ...

wpf - updated dependency property not firing binding

I have the following dependency property: public bool IterationSelected { get { return (bool)GetValue(IterationSelectedProperty); } set { SetValue(IterationSelectedProperty, value); } } public static readonly DependencyProperty IterationSelectedProperty = DependencyProperty.Register("IterationSelected", typeof(bool), typeof(...

Accessing a resource via codebehind in WPF

I have a custom collection defined in my window resources as follows (in a Sketchflow app so the window is actually a UserControl): <UserControl.Resources> <ds:MyCollection x:Key="myKey" x:Name="myName" /> </UserControl.Resources> I want to be able to refer to this collection in the codebehind, which I expected would be by the x:N...

Converting 3D Max Model to XAML?

Are there any free tools for converting a 3D Max model to WPF XAML? Thank you. ...

How to connect a Button in a Silverlight ListItem DataTemplate, in a ResourceDictionary (Styles.xaml), with a handler?

OK, so the situation is I'm defining an ItemTemplate for a ListBox in a ResourceDictionary (Styles.xaml). The ListBoxItem Template looks something like this: <ControlTemplate TargetType="ListBoxItem"> <Button Command="{Binding Path=DoSomeCommand}" Content="Test" /> </ControlTemplate> Now wherever this template is used, I'd like ...