xaml

WPF Global Resources in App.xaml

I have created a custom Treeview control and am trying to access the HierarchicalDataTemplate resource of this control from another page in the same project. my this.sceneTemplate property is coming up null. I have looped through all the objects in the dictionary and it does exist. How can I access this template? Thanks App.xaml <A...

How to set widths of columns in Listview in WPF?

Hello, I have a listview and I need to have width of first column automatic (so the width is properly measurized) and second column that will take the rest of space in the head of listview. How can I do that? My XAML looks like this right now: <ListView HorizontalAlignment="Stretch" ItemsSource="{Binding ListViewItemsSource}" ...

Is it possible to include XAML ControlTemplates inside a ControlTemplate?

I'm working on an app that uses ControlTemplates to produce images dynamically. I need to create a unique XAML ControlTemplate that works as a css-sprite containing all other ControlTemplates XAML. Is it possible to include ControlTemplate XAML inside another ControlTemplate and keep the aggegated and individual files separated? ...

What's ControlTemplate TargetType attribute for in XAML? Can I avoid using it?

What's ControlTemplate TargetType attribute for? Can I avoid using it? ...

Is there a way to create a single css-sprite from multiple XAML ControlTemplates?

Is there a way to create a single css-sprite from multiple XAML ControlTemplates? I have several ControlTemplates and I want to combine all those images into a single XAML file and then create a single css-sprite. Thanks in advance. ...

WPF style/control template reuse

Hi, I'm new to WPF, and I would like to know how to reuse some annoying xaml I have to avoid duplicating. <Button Cursor="Hand" HorizontalAlignment="Left" Margin="0,0,0,0" x:Name="MyButton" Style="{StaticResource ButtonTemplate}" Width="286" Content="hi!" Focusable="False" IsTabStop="False"/> <Button Cursor="Hand" HorizontalAlignment="L...

WPF DataGrid vertical sizing

I want to place a DataGrid inside a HeaderedContentControl but the the DataGrid does not get a vertical Scrollbar. It appears to be sized to hold all rows at once, the bottom disappearing from view. If I place the same DataGrid in a Border elelemnt I do get the behaviour I want. I have reduced it to this minimal example: <Grid> ...

How to compile XAML into C#?

Hello, is there a way how to see XAML compiled into C#? It would be really useful because I would not have to look for "how to do something in WPF programatically". Thanks! ...

[WPF] Can you bind to a dependency property of a custom behavior?

I created a custom behavior that exposes some custom dependency properties whose values change based on AssociatedObject. I am using these properties for binding in other objects. Conceptually, think of it like this: At runtime, the value of the dep prop doesn't reflect in the binding. Debugging it, I see (certain ide...

How to bind local variable in WPF

I have silverlight usercontrol. This contains Service Entity object. see below public partial class MainPage : UserControl { public ServiceRef.tPage CurrentPage { get; set; } ... } I need to bind CurrentPage.Title to TextBox My xaml is here <TextBox Text="{Binding Path=CurrentPage.Title, RelativeSource={RelativeSource self}}"></T...

WPF binding Ancestor object as CommandParameter

I have a Custom usercontrol that I want to enlarge. I tested this whit a function call on MouseDoubleClick and it worked fine. Code: XAML <cc:UserControl ItemsSource="{Binding Path=DataItem}" MouseDoubleClick="UserControl_MouseDoubleClick" /> CodeBehind c# private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs ...

XAML Page constructor

Hi there, I have a Silverlight 4 application. What would cause the Constructor in my codebehind file to be called more than once? Currently I suspect it gets called when I set the datacontext or do applytemplate. I can see it when I debug the application and I put a breakpoint on the first line in my constructor, BUT it does not give...

Visiblity as resource in XAML

Hi, To make things simple I thought I could add some settings in my resources and bind it to whatever/whenever I need it. For example, I wanted to be able to toggle the visibility of some objects. So I made the following XAML: // Namespaces.... xmlns:win="clr-namespace:System.Windows;assembly=System.Windows" // Namespaces.... <UserCont...

IEnumerable DependencyProperty throws errors when set in XAML

I have a custom control Workspace that inherits from Control and within it is a DependencyProperty that I need to contain a user-specified IEnumerable<IFoo> (I have also tried making it an non-generic IEnumerable). Public Shared ReadOnly FoosProperty As DependencyProperty = DependencyProperty.Register("Foos", GetType(IEnumerable(Of IFo...

WPF Converter with Property vs MultiConverter?

What is the difference between using a Converter (IValueConverter) and passing in other values as parameters (ConverterParameter) vs using a MultiConverter (IMultiValueConverter) and just passing in multiple converter values? ...

How to speed up WPF development

I've been developing with WPF for many months now. It's a great framework and I'm able to do fancy, elegant stuff that would have been a lot more difficult with WinForms. However, I do have the feeling that for normal "line of business" type of applications without any special UI requirements, it still takes me longer to code the UI in ...

Ideal UI markup language

A friend of mine and I are looking to start a project looking into accessible user interface (for blind users) design. There are a number of projects making existing GUI's accessible by tagging them with audio information but we're looking to work from the ground up and actually take input from a ML and create an accessible application....

Referencing Nested Type in Visual Studio 2008 XAML Designer

Hello, With the following resource definition <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="AccountTypeValues"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="domain:Account+AccountType" /> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> the designer complains t...

Staggered Column Labels in Silverlight Toolkit Chart

Hi, I need to style the chart control in silverlight toolkit to look like this http://img375.imageshack.us/img375/3758/chartstyle.png wherein the column labels are staggered. Can anybody lead me to the right direction on how to accomplish this task? Examples would be greatly appreciated. Thanks, Keith ...

Mobile Business Apps - any way to use XAML?

Hi I'm making a business mobile app to run on Intermec rugged devices. I would like to use XAML/Silverlight/WPF. It seems that this is not possible and I will need to use WinForms. Can any gurus confirm this please? Thanks a lot. Mark ...