wpf

traverse down through a radtreeview

I need to traverse down my radtreeview programmatically. All I have to start with is the root of the tree. I also have to check first if children nodes exist or not. I have done this before in windwos forms but now I have to deal with it in WPF, Telerik RadTreeView control and .NET 4.0. What is the best way to do this? How to I even get ...

Supporting additional Uri Schemas for the Image.Source property

Is there a way to make the following code behind expression to evaluate to true given the Xaml below. I'm asking this question because I have to work with a Library that converts FlowDocuments containing Images to HTML. Only the "Source" Attribute of the Image Control is persisted and you can't use the standard approach of using a Bitmap...

What is the "+<>c__DisplayClassX" type suffix where X is a number?

I have an exception thrown by a WPF application. The message is: Type 'MyNamespacesPath.AType+<>c__DisplayClass5' in Assembly... is not marked as serializable The problem is that the type cannot be serialized. But that type is autogenerated, maybe an anonymous method or expression tree. Anyone knows the exact origin of these kinds of ...

WPF - Elegant way of disabling and enabling different controls based on different states of the Model using MVVM

Hey guys, I am looking for an elegant solution for the following problem. Let's assume we have a (View)Model with the following boolean properties: Alpha Beta Gamma Delta Next I have 5 controls on the surface that shall only be visible when a condition based on those properties are met. Of course, as soon as one of those properties...

Specifying which screen my application should open on

I've created two WPF applications that are designed to run full screen on the same server with dual monitors. Is it possible to specify which application opens on which screen? I currently have the executable on different monitors desktop which works but ideally I'd like to control this programmatically. If that isn't possible, then ...

How to adjust a FlowDocuments fontsize relative to its container ?

I have a FlowDocument inside a FlowDocumentScrollViewer. The size of the container changes. So does the size of images in the FlowDocument: <Paragraph> <Image Source="/InnovationsforumInfoterminal;component/res/wohnzimmer.jpg"></Image>--> </Paragraph> The text-size however always stays the same: <Paragraph FontFamily="Arial"> ...

In XAML is there a way to default the UpdateSourceTrigger to PropertyChanged?

In XAML (or code) is there a way to default the UpdateSourceTrigger to PropertyChanged for all bindings? http://msdn.microsoft.com/en-us/library/system.windows.data.binding.updatesourcetrigger.aspx http://msdn.microsoft.com/en-us/library/system.windows.data.updatesourcetrigger.aspx ...

Background and UI Threads in a WPF Application

I am reading DataModel-View-ViewModel pattern: 2 I don't really understand the need to check if I am in the UI or Background thread. what if i skip the checks. Also, the code below ... [Conditional("Debug")] protected void VerifyCalledOnUIThread() { Debug.Assert(Dispatcher.CurrentDispatcher == this.Dispatcher, "Call must b...

Strange ComboBox Behaviour - WPF

I've got the following user-control: Resources: <DataTemplate x:Key="FilterComboDataTemplate"> <Label Content="{Binding Item2}" /> </DataTemplate> <Style x:Key="FilterSelectorStyle" TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding Filters}" /> <Setter Property="SelectedItem" Val...

What would be the best chioce, Windows Forms or WPF development in C#?

When learning the C# language. With all the applications being developed these days. Would I be better off focusing on windows forms development or WPF development. I want to develope software that uses ADO.net for SQL Server database access. Also stand alone applications to integrate with Microsoft Office to create charts and graphs etc...

Using a custom font in WPF

I need my WPF app to use a true-type font for a different language. I have the font located in a folder called 'fonts' inside the project. The font i'm using is available for free download here Since the font is installed in my system i first tried FontFamily="FMBasuru" I've read the post here and tried doing (this is the exact mark...

WPF 3D: How to convert a single AxisAngleRotation3D into separate AxisAngleRotation3D?

I have a 3D viewport that uses the TrackBall of WPF 3D tool to rotate the object by mouse. As a result, I get a single AxisAngleRotation3D with Axis vector like (0.5, 0.2, 0.6) and Angle of e.g. 35. That's fine. What I would like to do is, as an alternative, to give user the ability to rotate the object by individual axis (i.e. x, y, z)...

How to enable auto-scroll for silverlight page

There is a Silverlight page, it's width is 810 pixels, height is not specified: <NavigationControls:Page x:Class="VfmElitaSilverlightClientView.Pages.SquadView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsof...

WPF Slider and dates

I want to make slider to select dates. For example, every hour in last two days. Also slider should has a legend on the bottom with values. How could I do it? I made slider with data context as DoubleCollection from total hours in date and changed tooltip using custom ValueConverter. But when I change value, tooltip shows real values - ...

fetch selected row from DataGrid

I'm using WPF Grid. The first column is a CheckBox column, and there is one save button on my page. When the button is clicked, I'd like all the checkboxes row to be set checked, insert a in a datatable. How can this be done? ...

C# : WPF Mouse Over

Hi, I need to create a WPF application , which contains two windows.. the window1 contains a button. i need to show the second window when the cursor is over the button in first window [ Like tooltip ] . if the mouse leaves, the second window should close.. I'm new to WPF. can any one help me with a sample code ...

How to use autocomplete in a datagrid?

I have a Datagrid with a DataGridTextColumn. This is populated by using databinding, and can be edited by users. Is it possible to add autocomplete to the DataGridTextColumn ? ...

.NET WPF Window FadeIn and FadeOut Animation

Hi All Below is code snippets of a window FadeIn and FadeOut animation: // Create the fade in storyboard fadeInStoryboard = new Storyboard(); fadeInStoryboard.Completed += new EventHandler(fadeInStoryboard_Completed); DoubleAnimation fadeInAnimation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.30))); Storyboard.S...

Xbap arrow keys jump to the address bar

In an xbap application, when navigating listboxes, comboboxes etc with the arrowkeys, reaching the end of the list will result in focus jumping to the addressbar of the browser. Very annoying.. Any ideas on how to avoid this behaviour? ...

MVVM and DataGrid View re-use as embedded controls within otherviews with subset data.

Okay here's the situation. Net 4 WPF NO Silverlight. I have several Views that present a datagrid showing the contents of some observable collections e.g. ObservableCollection<ClassAViewModel> sourceA; ObservableCollection<ClassBViewModel> sourceB; ObservableCollection<ClassCViewModel> sourceC; The collections are populated by a call...