xaml

Changing the path a property is bound to at runtime

Hi, I have a ComboBox with a list of objects bound to it. Currently i have the items templated so they show only the property Class.Name. so the ComboBox is full of Class.Name However i am required to give the user the option to display the property Class.Description instead. If it were just that easy i would be fine, but they want the ...

Conditional execution of EventTriggers in Silverlight 3

I'm currently working on the UI of a Silverlight application and need to be able to change the visual state of a control to one of two possible states based on it's current state when handling the same event trigger. For example: I have a control that sits partially in a clipping path, when I click the visible part of the control I want...

How to change the border on a listboxitem while using a predefined template

Hey, I'm using one of the defined wpf themes for my application, so all my controls automatically are pimped according to that theme. Now i am filling a listbox with items (usercontrols), but not all of them should be visible at all time. But when i'm setting height to 0 (of usercontrol) or setting to invisible, i get a thick grey bord...

WPF: Checkbox in a ListView/Gridview--How to Get ListItem in Checked/Unchecked Event?

In the code behind's CheckBox_Checked and CheckBox_Unchecked events, I'd like to be able to access the item in MyList that the checkbox is bound to. Is there an easy way to do this? <ListView ItemsSource="{Binding Path=MyList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" MinHeight="100" MaxHeight="100"> <ListView.View> <Gri...

Scope of controls inside Silverlight XAML

I have defined a textbox with x:Name="txtMyTextBox" inside UserControl called MyView. I've noticed that I can do the following: MyView myView = new MyView(); myView.txtMyTextBox.Text = "something"; Why txtMyTextBox is accessible that way? Is it public or internal field? Can I make it private? ...

WPF DataGrid: Resource per row?

Is there a way to xamly set a StaticResource per row in a DataGrid accessing it from all the columns? UPDATE My aim is to have 3 ComboBox columns, while only the last one is actually bound to the rows item. For instance, the DataGrid represents a list of Items. I have Category->Vendor->Style->Finish ComboBoxes, but those are only for ...

Silverlight: Scrolling with a StackPanel

I have a grid, 3 by 3 (3 rowdefinitions and 3 columndefinitions). I want some content (a StackPanel) in one of those grid cells to scroll. I'm fairly sure this is possible but I cannot figure out how. I've tried adding ScrollViewers and Scrollbar controls to the grid cell I want to scroll, but this usually ends up creating scrolling for ...

How do I Show/Hide a Grid Row and Grid Splitter based on a Toggle Button?

Currently I have a toggle button that is bound to a boolean property (DualLayout) in my code behind. When the boolean is set to True, then I want my second row in my grid (and grid splitter) to hide and have the first row take up the entire space of the grid. Once the boolean is set to False, I want the grid splitter and bottom row to ap...

WPF DataTemplateKey can not find ListBox key

I am fairly new to WPF and am having trouble getting the DataTemplateKey to find my ListBox. <Window.Resources> <ControlTemplate x:Key="FocusTemplate" > <Rectangle Fill="Azure" Width="290" Height="55" /> </ControlTemplate> <Style x:Key="FocusStyle" TargetType="{x:Type Control}"> <Setter Property="Template" V...

WPF: Bind/Apply Filter on Boolean Property

I want to apply a filter to a ListBox accordingly to the IsSelected property of a CheckBox. At the moment I have something like this. XAML <CheckBox Name="_filterCheckBox" Content="Filter list" Checked="ApplyFilterHandler"/> <ListBox ItemsSource="{Binding SomeItems}" /> CodeBehind public ObservableCollection<string> SomeItems { ...

WPF Infinite loop in references found while processing the Template

I am pretty new to WPF and am getting this error after my mouse is over my custom listbox item. Error: Infinite loop in references found while processing the Template for an element named '' of type 'System.Windows.Controls.TextBox'. <Window.Resources> <ControlTemplate x:Key="MouseOverFocusTemplate" > <Grid> ...

WPF: Xaml, create an observable collection<object> in xaml in .NET 4.0

the web site says you can in .NET 4.0 I cant seem to do it though, what assesmbly references and xmlns' do i need the following does not work xmlns:coll="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib" <coll:ObservableCollection x:TypeArguments="x:Object"> <MenuItem Command="ApplicationCommands.Cut"/> <MenuIte...

IntelliSense and Folding Editor Not Working in Visual Studio 2008 SP1 for Certain Files Only

Ok, I have an issue that is driving me nuts. In certain xaml files only, neither IntelliSense nor the folding editor is working. I have noticed that if I delete the local namespace and add it back, the folding editor starts working. If I delete the local namespace and don't add it back, IntelliSense starts working as well. Of course, I...

What's the best way to handle layout issues with multi-language support in WPF/XAML?

I'm creating a standalone WPF app with multi-language support. I've found some great resources (mostly on SO) on how to store and access the strings as needed. This part is pretty straightforward and doable, but I'm fuzzy on how to take care of screen layout issues. I'm using some custom images to skin up my app for buttons, etc. For in...

WPF Custom ListBox as Buttons Click not firing

I am attempting to have a ListBox of TextBoxes with click events. I have read that one way to achieve this was to have a list of Buttons and call ButtonBase.Click="" on the ListBox. This was not working. Any advice as to how I would hook up a click event to the listbox items? I was also trying to change the style if the button was ...

Binding to dynamic objects in Silverlight 4

I've noticed that in .Net 4, WPF FrameworkElements are able to bind to IDynamicMetaObjectProvider binding sources. Will this also be the case for Silverlight 4? ...

How to save user imputed value in TextBox? (WPF, XAML)

How to save user imputed value in TextBox? (WPF XAML) So in my xaml window I have a TextBox. User sturts my application inputs some values in to it and presses a button or hints Enter. He closes an app. Opens it up again. How to make his inputs be saved in that TextBox in WPF? ...

What are the real-world benefits of declarative-UI languages such as XAML and QML?

I'm currently evaluating QtQuick (Qt User Interface Creation Kit) which will be released as part of Qt 4.7. QML is the JavaScript-based declarative language behind QtQuick. It seems to be a very powerful concept, but I'm wondering if anybody that's made extensive use of other, more mature declarative-UI languages like XAML in WPF or Sil...

Why is my namespace not recognized in Visual Studio / xaml

Hello, these are my 2 classes a Attachable Property SelectedItems: code is from here: http://stackoverflow.com/questions/1297643/sync-selecteditems-in-a-muliselect-listbox-with-a-collection-in-viewmodel The namespace TBM.Helper is for sure proper as it works for other classes too. The namespace reference is also in the xaml file AND ...

How can i navigate one xaml page to another?

i have 2 page i need to navigate mainpage.xaml to login.page xaml but it throws me Object reference not set to an instance of an object. in Root.Children.Clear();.... i added this codes in App.xaml: private void Application_Startup(object sender, StartupEventArgs e) { Grid myGrid = new Grid(); myGri...