xaml

How unique is XAML?

Was talking to a colleague about XAML and how it is both a presentation and object description language and therefore quite unique and novel among IT technology. Is this true that XAML is unique and novel? Does XAML have any counterparts or predecessors in the Java world or elsewhere? I believe someone told me that Java Server Faces w...

How can I get a list of built-in routed events in WPF

I'm just starting out with WPF and need some help with routed events. I have added a datagrid with some animation, but i can't seem to find anywhere that shows me a list of routed events to use on the datagrid, or any other control for that matter. Seems to be a guessing game so far. I thought the datagrid standard events, such as C...

Problem DataBinding wpf KeyedCollection

Hello, I am a beginner to WPF Databinding and I just found a confusing kind of behaviour. Maybe someone can help me: My xaml code binds a listbox to a list: <ListBox ItemsSource="{Binding Path=Axes}" SelectedItem="{Binding Path = SelectedAxis}" DisplayMemberPath = "Name" Name="listboxAxes"/> If the actual item that is binded to is ...

Get value from DataContext to MarkupExtension

I'm using M-V-VM pattern In my VM I have code like public class ViewModel { public XmlDocument Document { ... } .... } I have a markup extension from which I would like to use said document public override object ProvideValue(IServiceProvider serviceProvider) { IProvideValueTarget valueProvider = serviceProvider.Ge...

Adding events to ScatterViewItems when implicitly creating them

Not sure there's too many surface developers on here but hey ho... If i have a scatterview which implicity creates the ScatterViewItem objects (see below), is it possible to retireve the contact events for each scatterViewItem? Also when i wrap tyhe image object in a ScatterViewItem explicitly the item no longer works. Could anyone adv...

C# WPF IsEnabled using multiple bindings?

I have a WPF xaml file describing a section of a GUI and I'd like the enabling/disabling of a particular control to be dependent on two others. The code looks something like this at the moment: <ComboBox Name="MyComboBox" IsEnabled="{Binding ElementName=SomeCheckBox, Path=IsChecked}"/> But I'd like it to be dependant on anot...

WPF Sort ListView by Date

Hi. I have a WPF ListView with a column that has dates in it. I would like a way to custom sort the dates (by date value, rather than string value). Is there a way to do this? Right now I am using list.Items.SortDescriptions to sort using another column, but I would like to change this to sort on the date column instead. Thanks. ...

Is it possible to share a ResourceDictionary file between multiple projects?

If I have a ResourceDictionary in one project, is it possible to create another project that uses resources defined in the first project? Note that both projects are WPF Applications, not ControlLibraries. Thanks!! ...

Can you convert a XAML DrawingImage back into an SVG for editting?

A design company made an application design in WPF 2 years ago, and now we're looking at changing the text on one of the images. No SVG files were provided, only the XAML code used, and the developer who worked on the project at the design company no longer works there. I know he used Expression Blend for the design. Any help with possi...

Silverlight - Load XAML file via C# (just like in the WinForms days) - How?

So I'm new to SL coming from a WinForms background where I could instantiate a UserControl or Form like this: MyForm frm = new MyForm(); frm.ShowDialog(); So in SL, I created a simple Page.xaml and a second xaml file called Page2.xaml - I dropped a button in the Page.xaml file and within that button's click event, I tried adding the f...

Encapsulating and customizing a third party WPF control

I'm interested in customizing a 3rd party control, such as Telerik's RadGridView, as a standalone control, for example adding New Row and Delete Row buttons above the grid, yet still supporting XAML manipulation of the internals of the control by the window upon which my control exists (i.e. for the window to add its own style to a colum...

What is the easiest way to break up large XAML files in my application?

I recently discovered that I could make use of user controls to reduce the size of my main application's .xaml file. I am new to WPF and realized that my app's XAML is getting very long, very fast and is cumbersome to scroll through. Are user controls the best way to address this issue (i.e. have lots of user controls and their template...

Setting the tag member of a ListBoxItem inside a datatemplate?

Hi, How would I be able to set the tag member of a ListBoxItem inside a datatemplate? I am databinding a ListBox and I am trying to add information to the ListBoxItem.Tag from my DataContext. I am using A DataTemplate to display the ListBoxItem. ...

The proper way to do this - binding to properties

Hi all, I have 2 controls that both bind to the same dependency property "Weather". In the first control you put the current weather, the other one displays a forecast. In my XAML of the first control I bind a TextBox that contains the "Humidity" as follows. <TextBox Text="{Binding Weather.Humidity}" /> Whenever the Humidity changes...

Help understanding relationship of Resources/Styles/XAML files in Silverlight

I'm new to Silverlight and I wanted to accomplish a relatively simple task:    Create a "panel" control that would display a heading and some child content. I was able to get this work to a degree, but the placement of the XAML really confuses me. On my page I use my control. This results in my panel being shown with a button in the ch...

How to set up Header/Lines in WPF/Silverlight

Hi, Do you have any best practices for setting up Header/Lines forms (Also known as Header/Details) in WPF or Silverlight? Preferably using the Mode-View-ViewModel design Pattern to fit in with the rest of my application. An example would be if I had a grid that displayed all SalesOrders in the database, and the underneath that a grid ...

TabControl without border wpf (XP)

Hi! I'm experiencing a visual issue with styling a TabControl in WPF. So even if I set the border of the tab control to be 0px and transparent there is still a very thin line on the right and bottom borders. I didn't manage to find the property which would resolve that, so maybe someone experienced the same issue and could share it. ...

Customise WPF "Slider" control to slide on a path

What would be the best way to get a slider control that slides on a path. At the moment I think the path I will use is a half circle arc. But I may need to change this later (or create other sliders with different paths. So I need to take that into account. Would it be best to start with the default Slider control and modify/extend it? ...

WPF ControlTemplate Style GradientStop in Trigger

Here is my XAML for a TabItem. I want to be able to set the Color of a single gradient stop in a trigger. I know that I can re-define the gradient completely in the trigger's setter, but I want to access a specific property on the background so I can animate it in the future. I have tried every variation of everything in the trigger's s...

WPF SystemColors: color of TextBox border

I am trying to make a search TextBox with an embedded magnifying glass icon. I have the following markup so far: <Border DockPanel.Dock="Bottom" Margin="2,4,0,4" BorderThickness="1" SnapsToDevicePixels="True" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"> <DockPanel> <Sta...