wpf

Can't find types in ResourceDictionary when loading with XamlReader.Load

In my prism module, I have the following code snippet: using (var manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MyAssembly.CaseHost.ViewModelDataTemplates.xaml")) { ParserContext context = new ParserContext(); context.XmlnsDictionary.Add("local", "clr-namespac...

XML databinding to TreeView with child nodes of different types under the same parent

Note: See the bottom of this post for the solution. I'm trying to use XAML's "HierarchicalDataTemplate" to display an xml document in a TreeView. My current XAML code will display the first child of the "Parent" node but not subsequent child nodes of different types. Can I use XAML to display children of different types under a common...

WPF bubble messages like in the iphone sms

Hi Can you refer me to an WPF implementation of a "sms chat bubbles" where I can feed texts in different colors for questions and answers (like in the iphone sms application) : http://www.mobilelove.org/wp-content/uploads/2010/01/iPhone_sms_Bubble_style_by_alexandergre.jpg If you can think of other nice solution, I'm interested as wel...

How can I get the GroupItem in the grouped listview drop event handler

I have a grouped ListView and want to add drag & drop wised regroup support to the ListViewItem. But I have no idea about how to get the destination GroupItem in the drop handler and then regroupping the dragged item to it. ...

ListBox.ItemsSource {Binding ...} doesn't work, but if I set the ItemsSource in code, it's all dandy!

Hello, I am experimenting with WPF and I came across a problem I can't seem to figure out although I have done some work with Silverlight previously and used DataContexts, Data Bindings and INPC successfully. This time I am stuck... I am using this code to create an instance of the application's main window: protected override void OnS...

Are there any designers for WPF resource dictionaries?

I've discovered to my great annoyance, that once I move a color gradient or some other complex style to a resource dictionary it is out of Expression Blend's Visual Studio WPF Designer Thingy's jurisdiction and must be edited in XAML. I have no issues with working in XAML except that it is more time intensive than a designer. So my que...

Filter WPF TreeView using MVVM

Hi, I currently have a TreeView which has the following structure: <TreeView ItemsSource="{Binding RootViewModels}" FontSize="12"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="local:TreeViewItemBehaviour.IsBroughtInto...

WPF Two-way binding to a dataset - updating the database?

Okay, so I'm fairly new to WPF and data binding, but I've searched and searched and can't seem to find an answer to this. I have a database (called Inventory), and a dataset (called DevicesDataSet). What I'm trying to do is bind the dataset to a listbox, so that a specific device from the Devices table of the DevicesDataSet can be sele...

C# WPF Progress Bar ControlTemplate Update Text

I've create a control template for a progress bar that includes a textblock where I want to put the update the text based on the % of a file downloaded. I've no problem getting the % etc. I just want to know how from the c# code do I target the textblock. Here is my controltemplate <Style TargetType="{x:Type ProgressBar}"> <Setter...

Preventing WPF CommandManager executing CanExecute

Is it possible to prevent the WPF CommandManager from executing it's attached CanExecute delegates? I have an Unhandled Exception Handler routine that displays an error window for the user. I have a situation at the moment where an exception is being thrown as part of a CanExecute chain. This invokes the exception handler, which displ...

WPF Updating IValueConverter through code

I'm trying to figure out if its possible to update an IValueConverter through the code behind. My situation is that I've got two ComboBoxes. Once the first one is updated, I change the ItemsSource property of the second to be one of a variety of enums. I've grabbed an EnumToFriendlyNameConverter from CodeProject, but I'm not sure how to...

WPF - implementing multilanguages applications - binding problem

Hi I have to add support for other languages in my application. Almost entire application is ready however I have a problem with translating a tooltip which is 'loaded' from resourcesDictioanry file. For couple element in my application I have the same tooltip. So instead of writting the same code over and over again I decied to put a to...

XML Documentation for dependency properties

What is the best way to document a dependency property? Should I put the xml documentation on the field: /// <summary>Documentation goes here</summary> public static readonly DependencyProperty NameProperty = DependencyProperty.Register(...) or on the property: /// <summary>and/or here?</summary> public string Name{ get{......

Silverlight: Create Tabbed browser view using Prism?

Well I have this application requirement with following design needs, My main region is Tab Control. There is a fixed (you cant close) search tab Module where I can search list of projects, but when I double click on the selected project should open on its own view in the same Tab Control, however Project Detail Module is altogether ve...

How to access new visual tree when WPF TabControl SelectedItem changes

Considering an already loaded and rendered TabControl with three tabs, with selected tab being index 1 (the middle one): Tab 1: Has one TextBox Tab 2: Has two TextBoxes Tab 3: Has three TextBoxes If I iterate through the selectedItem's visual tree with VisualTreeHelper, I will get Two textBoxes within the TabControl's children. I wa...

Why is my WPF Frame not rendering anything? Known bug?

I have a WPF Frame with a web-based HTML source and though the contents are there, they aren't showing up. I know that the content is there because if I right click in just the right spot I can save images. Also, if I do print preview it shows just fine. The stuff is there, but it isn't showing up. Is there a known bug? ...

WPF Windows from assembly being 'themed' by host app

I have some assemblies that contain WPF windows and code to provide common functionality when working with in-house systems. As an example - browsing a database and selecting an object. I've integrated this into a third-party WPF app, but the controls in my own assembly are now being "themed" in the style of the host app. For example my...

Wpf ComboBox validation Trigger

I have a editable combobox that text is bound to an object property. I have associated a exceptionsValidationrule with the text property and it is working and turning the control red. I need to also disable a button but I can't seam to find how to check the validation.haserrors in this case my XAML for the combo box <ComboBox Margi...

How do I make it possible for a popup to come up, based upon the selection a user makes in a grid view?

I've got a ListView object, with a GridView within it, where I'll be putting data. The list view is in SingleMode. I want it so that the user can select a row, and based upon criteria in that row, it would then bring up a popup display relevant data to the selected row. There are 2 possible ways I envision this could happen. I could ...

Scrolling to the end of a single line WPF TextBox

This seems like such a simple thing but I just can't get it to work. I have a single line text box that has a lot of text. What I want to happen is that whenever the text box receives focus, it scrolls to the end of the text so that it comes into view and the cursor is at the end ready to accept new text. In the text box's GotFocus ev...