xaml

WPF: Any reason why there's a xamlparse exception on XP but not on Vista?

My app compiles fine. Runs fine on Vista machines. But doesn't even start on XP machines with a xaml parse exception on the first form. The xp machines all have .net 3.5. Anything spring to mind? Thanks. ...

How to implement Balloon message in a WPF application

We would like to use balloon messages as described in the UX Guide from Microsoft. I found some samples which uses native code from Windows Forms, but the native code requires a handle to the component which a bit difficult for a WPF application since it doesn't follow the same concept. I found some sample code which uses WPF's decorato...

XAML in VS Shell: Loading an assembly without reference

Hi, I'm currently trying to customize a Visual Studio Isolated Shell so it opens a XAML file and its designer without a solution or a project. Therefore, for the designer to load, Visual Studio need to recognize every xaml tag in the XAML file or it won't load telling me that the document contains errors. I'm currently trying to manual...

Error ! Couldn't create instance of type (Designer Reloading Problem)

Hi I am using Linq-To-Sql I made a class by overloading observable collection.. After that i added assembly namespace of my project. xmlns:s="clr-namespace:WpfApplication1" Window.Resources <s:DataBinding x:Key="EmpName" /> ...... /Window.Resorces After that make a data template to bind controls.. After all thing d...

Pass WPF Button Command through UserControl

Hi, I've created a WPF UserControl which contains a Button. I now want any consumer of the usercontrol to be able to set a Command property on the usercontrol, and for that command to be assigned to the button within the control. i.e. so that when the button is clicked, it runs the command (in this case a Prism DelegateCommand). So, m...

Binding Super Header Columns to DataGrid Column Width in Code

I've created a grid of super headers that bind to a datagrid. The super headers stay positioned over their respective datagrid columns during resizing of datagrid columns. The XAML binding is great and everything works fine. The only problem however, is that I need to be able to construct this dynamically in C# code. Tried a number of...

Nested Controls and properties

Hi, I have a UserControlB which exposes a Title property of type string. I then have a UserControlA which contains one UserControlB and exposes a property called MyNestedControl which returns the instance of UserControlB. In my main page I'm declaring a UserControlA and I'm trying to set the value of the Title property as follow MyNest...

WPF Custom Combobox Header

How do I create a custom header for a combo box using WPF and VB.NET? I would like to have items in the dropdown list to show an image next to text, but when the item is selected, have only the text show in the closed combobox. Also, I would like to be able to do this in the code, without using data templates. Is this possible? ...

How to specify a name for a "page" in Silverlight 3, with the Frame navigation control

I am using the Frame navigation control. Programmatically, I specify the page to fill the frame (like "Views\Home.xaml"). The browser is currently using string specified in the Frame control as the name of the page; in other words, the browser displays "Views\Home.xaml" as the name of the page. I tried setting the "Name" property on...

Create a Dictionary in xaml?

Pseudo example: <Window> <Window.Tag> <x:Dictionary KeyType="{x:Type sys:String}" ValueType="{x:Type sys:Int32}"> <sys:DictionaryEntry Entry="{sys:DictionaryEntry Key0, 000}"/> <sys:DictionaryEntry Key="key1" Value="111"/> <sys:DictionaryEntry> <sys:DictionaryEntry.Key> <sys:String>Key...

Use DataContext as CommandParameter in WPF

I want to pass the current DataContext (which is an instance of a ViewModel) as a CommandParameter on a WPF Button. What would be the syntax I should use? <Button x:Name="btnMain" Command="infra:ApplicationCommands.MyCommand" CommandParameter="{Binding ???}" /> ...

DataTemplated ListBox items not responsive to mouse clicks

I'm trying to create a ListBox in which the text of the items is bound to the regionName property of the objects in its ItemSource. This is displaying as it should be, but clicking on the text created by the binding does not change the ListBoxItem's state to "selected" (although clicking on the space after the text selects the item.) The...

How to bind a ComboBoxItem's IsEnabled property to the result of a Command's CanExecute method.

I've a custom SplitButton implementation in which contains a ComboBox with several ComboBoxItems bound to commands. I can bind to the Name, and Text properties of the command just fine but have no way of binding the ComboBoxItem's IsEnabled property to the result of a Command's CanExecute method because it is a method. Is there some synt...

How do I make a simple image-based button with visual states in Silverlight 3?

At my previous company, we created our RIAs using Flex with graphical assets created in Flash. In Flash, you could simply lay out your graphics for different states, i.e. rollover, disabled. Now, I'm working on a Silverlight 3 project. I've been given a bunch of images that need to serve as the graphics for buttons that have a rollo...

Can I convert XML/XAML into WPF controls at runtime?

Is there a way to take a chunk of XML/XAML and load it as WPF controls at runtime? Related: Can I use XamlReader.Load or InitializeFromXaml from a WPF Window, for the Window definition? ...

Negate or Not Condition-Element for MultiTrigger

I´m currently learning WPF and the use of MultiTrigger and Conditions to set some properties of the styled control. I know that the Conditions of an MultiTrigger must all met (AND-Operator) to set the value specified by the Setter. But does there exists a Condition if the value is not met (Lets name it a NotCondition). I have a small ex...

How can I define how many spaces a TAB jumps in a XAML TextBox?

When the user presses a tab in this textbox, the cursor jumps an equivalent of 8 spaces. How can I change it so it jumps only 4 or 2? <TextBox Width="200" Height="200" Margin="0 0 10 0" AcceptsReturn="True" AcceptsTab="True" Text="{Binding OutlineText}"/> ...

Is there a way to get the state of which TreeView nodes are expanded/collapsed?

This code example shows how to get the position of the scrollbar in a ScrollViewer (with ScrollToVerticalOffset) so that e.g. you can reset the scrollbar to this position if you need to recreate it. Is there any way to do this for a TreeView control, i.e. get a collection of node indexes which the user has expanded? ...

The calling thread must be STA, because many UI components require this.

I am using : http://www.codeproject.com/KB/IP/Facebook_API.aspx I am trying to call the xaml which is created using WPF. But it gives me a The calling thread must be STA, because many UI components require this. error I don't know what to do. I am trying to do this: FacebookApplication.FacebookFriendsList ffl = new FacebookFrie...

XAML how to call GUI

Hi, How can I call the UI for an XAML from another class please? Thanks. :) ...