wpf

Associate a file extension with WPF application

I have a nice little assignment organizer that I want to add a backup option to. But I don't want it in an ordinary xml file or someother file because of the possibility of file corruption. So how can I make a file extension that the program knows and can save to and open with a .asog file extension? ...

How do I programmatically bind a ContentControl's content to the DataContext?

Can someone help me translate this to CLR code: <ContentControl Content="{Binding}" /> ...

Publish Version vs Assembly (etc) Versions

Hi! I've read threads here about the Assembly, File and Assembly Informational versions. I'd like to know where the Publish version fits in. The result of... string thisAppsVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); ...appears to be the AssemblyVersion. Up until now I've been using the ...

Silverlight/WPF and Blend: DataBind a text field, but define a design-time value?

Hopefully this is simple - I DataBind a bunch of labels and text controls in a Silverlight application (to DependencyProperties that I create in my class), but of course the text is empty at design time. I'd still like to have an idea of how this will be laid out; is there a way to specify a design-time value, even though it's databound...

Putting a ContentControl *inside* a WPF DataTemplate?

I have a custom Expander control called SpecialExpander. It is basically just a standard Expander with a fancy header and a couple properties (HeaderText and IsMarkedRead). I began by creating a simple class: public class SpecialExpander : Expander { public string HeaderText { get; set; } public bool IsMarkedRead { get; set; } ...

Wpf TreeView's ScrollViewer Adjustment

I am using a Wpf TreeView, in which I am adding nodes at runtime. Some times tree goes bigger and ScrollViewer comes into picture(that is part of TreeView's ControlTemplate). But everytime I add a node, I can not see it, cos it is outside the page area, I need to drag the vertical ScrollBar's thumb down in order to see it. so I want the ...

Wpf: How can I know if TreeView is Updated?

I am using a Wpf TreeView, in this I can add TreeViewItems dynamically. Is there any way to know when the tree is updated? I tried with the CollectionChanged event of the ObservableCollection that I binded with the TreeView but that didn't work. Edit: My code is in like this: class Temp { public void Load() { DeriveA ...

How to express a List of Dictionaries in XAML?

I want to define a List<Dictionary<string,string>> in <Window.Resources> the XAML way, so I can bind to it later. ...

Recording video in C# and WPF from mediaElement

My application applies custom HLSL shader effects to a mediaElement using decorators. How can I record and save the modified video using the application itself in realtime? ...

Problem Inserting Report Viewer into WPF Application using WindowsformsHost

Hi I am trying to create a popup from my WPF application which shows a report viewer hosted in a WindowsFormsHost however I am having problems with the following Xaml <Page x:Class="FIS3.ReportViewer.ReportViewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

WPF Detect mouse move?

Well im trying to make my own basic Slider control just so i can learn abit how to interact with the mouse... so far i have this: vb.net: Private Sub Rectangle_MouseMove(ByVal sender as Object, ByVal e as System.Windows.Input.MouseEventArgs) If (e.LeftButton = MouseButtonState.Pressed) Then Dim p As Point = Mouse.GetPosition(Me) ...

Telerik Radgrid WPF

Hi, My WPF page has a RadGrid control provided by Telerik. The Grid is a nested grid which essentially means that clicking on the (+) sign on the leftmost column of the row expands the row into a Subgrid. This is being done by specifying a hierarchical grid in my XAML. Everything works just fine when you click on the row and expand the ...

WPF, width of child control should match width of parent container

Hi there I'm pretty new to WPF. I often find my self struggling with getting a bunch of child controls combined width to match a given parent container.. As in the following: <ListBox x:Name="BrugereListBox" Grid.Column="0" Grid.Row="3" DataContext="{DynamicResource Brugere}" ItemsSource="{Binding}" PreviewM...

Setting Window background color using resource

I need to use a resource to set the color of the main window in my WPF application. Since the resource declaration comes after the window declaration (I am importing a resource dictionary), I can't use a Background property in the Window object. So, I thought I would set the background this way: <Window.Resources> ... </Window.Resources...

Attached Property: 'System.TypeInitializationException' when setting default value

I want to set a default value of my Attached Property, but when I do I get: A first chance exception of type 'System.ArgumentException' occurred in WindowsBase.dll A first chance exception of type 'System.TypeInitializationException' occurred in Oef_AttDepProp.exe Without the default value, things work fine. This is some sampl...

Custom ComboBox control inside other custom ComboBox control, how to bind Items?

I created two custom ComboBox controls, both inherit from the default ComboBox control. public BlueComboBox : ComboBox {} public WhiteComboBox : ComboBox {} BlueComboBox contains a template and is styled properly and works perfectly. WhiteComboBox is a bit more complex. It contains a template consisting of a TextBlock and a BlueComboB...

Silverlight (4.0) for WPF guys

For years I have exclusively worked with WPF and never touched Silverlight. Is there a quick tour for WPF pros that introduces me to Silverlight (4.0) its unique features and its differences to WPF? ...

WPF - Dynamically Loading a Theme

I'm working on an application where I want to let my user choose which theme/skin they want to use. I'm using the pack of themes available from Codeplex. So I need the ability to dynamically load the theme. After research considerable number of sites, I found a number of samples that use code that looks like what I'm using - ...

How to stop DispatcherTimer from inside Try - Catch?

Please, help me to understand how I could stop attempts of executing MethodOne() inside a dispatcherTimer.Tick event handler of WPF DispatcherTimer after first unsuccessful attempt of doing it. TimeSpan ts = new TimeSpan(0, 0, 5); DispatcherTimer dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += ne...

What is the point of the StatusBarItem class in WPF?

How is the StatusBarItem class supposed to be used? Is every element in a StatusBar's content supposed to be wrapped with it? I don't really understand how StatusBarItem affects the StatusBar layout. It seems like I can use HorizontalAlignment on a StatusBarItem, but not when I put the element in the StatusBar directly: <StatusBar> ...