wpf

Prism2/MVVM Close View from ViewModel

How do I close a View from its ViewModel? I've a WPF window which has defined multiple Regions and being used as a Shell to host views for my application. I would like to have a View able to remove itself from the Region, or close it from a tabbed container. How can I accomplish this behavior from ViewModel. ...

How to relative scale size of User Control?

How to relative scale size of User Control like image (in image editor). Example (100%): Scaled down UC (70%): Well I achieve this in picture editor, but I would like in WPF. :) I need this to adjust my application to different screen resolution, while nothing hiding (no scrollbars). ...

Resize font in TextBox in Grid

My question below is answered but I just realised that now the Fontsize only resizes in one direction. Is there a possibility to bind two paths? Or another option? Previous question I have a Grid [20,20] with Textboxes in it. In these TextBoxes I put numbers. When the application starts up it's fullscreen. If I resize the window the ...

Do we need to Re-create Model Classes while using the Repository Pattern

Hi I'm using the LinqtoSQL for a WPF M-V-VM application, as I might want to change from LinqtoSql to something else in the future, like Entity framework or Subsonic etc, thus I found repository pattern to be helpful, My question is how do I create the model classes, suppose I have an table in the database, I understand that I cannot u...

Strange WPF Xaml behaviour - XAML grid element remaining null in Window_Load

I have a grid in a XAML file in a WPF project. This MainGrid contains 3 columns into which I have placed another 3 grids. If I arrange the MainGrid children in order 0,1,2 in the XAML e.g. <Grid Grid.Column="0" Name="grid0"></Grid> <Grid Grid.Column="1" Name="grid1"></Grid> <Grid Grid.Column ="2" Name="grid2"></Grid> then the grid2 r...

WPF WindowsFormsHost control captures Stylus events before they bubble

I'm working on a WPF 3.5 app and attempting to add multi-touch to a some older Windows Forms content (Flash ocx control). I expected to be able to throw a WindowsFormsHost control on a WPF Window, call CaptureStylus() on the WPF Window and then intercept all Stylus events before they made it down to the WindowsFormsHost. However, any t...

Convert SWF to Xaml

Are there any products out there that convert Flash SWFs to Xaml (I'm interested in WPF but Silverlight could work too)? ...

Is there a way to invoke the "Identify Monitors" function from C#?

I'm working on a little WPF app that will run fullscreen and I'd like to give the user the ability to choose which monitor it will display on. To make it easier to identify each monitor in the list, I would like to do something like the Windows Display Settings dialog's "Identify Monitors" button. Is there a way to invoke that function ...

Databind radiobutton group to property

Hello, I have a radiobutton group: <TextBlock Height="24" Text="Update Interval (min):"/> <RadioButton x:Name="radioButtonTimerNone" IsChecked="{Binding UpdateInterval, Converter={StaticResource updateIntervalToCheckedConverter}, Mode=TwoWay}"} Content="None" /> <RadioButton x:Name="radioButtonTimerOne" IsChecked="{Binding UpdateInterva...

My.Resources in WPF XAML?

Hello! Is there a way to access My.Resources thru Xaml? Like this <Image Source="{Binding MyImage, Source={x:Static my:Resources}, Converter={StaticResource MyBitmapToImageSourceConverter}}" /> This is the error I get: \Application.xaml(122,36): error MC3029: 'my:Resources' member is not valid because it does not have a qual...

WPF GradientBrush?

How Many type of gradient brushes are available like LinearGradientBrush, SolidColorBrush? and when we create a GradientStop how the offset works? LinearGradientBrush LGB = new LinearGradientBrush(); LGB.StartPoint = new Point(0, 0); LGB.EndPoint = new Point(0, 1); LGB.GradientStops.Add(new GradientStop(C...

How to print a WPF flow document table across multiple pages if there are too many columns to fit on one page?

Hi! I think the question title is self-explaining. I have a flow document with a table which has too many columns to fit on one page. Is there a way to print the columns across multiple pages? c1 = Column 1 c2 = Column 2 etc. +-------------+ +-------------+ | Page 1 | | Page 2 | | | | | | c1 c2 c3 c4...

Viewing Collada with WPF

I'd like to create a Viewer for Collada files, my question is, is there any native support for this in WPF? I am quite new to the 3D-parts of WPF so I don't know how everything works. So I'd like to know if it is even possible and if so, how hard is it? Examples? ...

What is the difference between StaticResources and DynamicResources in WPF?

What is the difference between StaticResources and DynamicResources in WPF? EDIT : This code in XAML file : <ComboBox Canvas.Left="14" Style="{StaticResource ComboBoxStyle}" Canvas.Top="137" Height="33" Name="cmbItem" Width="170" SelectionChanged="cmbItem_SelectionChanged"> <ComboBoxItem>Name</ComboBoxItem> ...

Binding to indexed property with String key

Say I wanna bind to dictionary that TKey is string with XAML: <Label DataContext="{MyDictionary}" Content="{Binding Item("OK")}" /> Doesn't work. How should I do it? I am talking about the Item("Key") ...

How to dynamically load modules in Prism / Composite Application Library?

I have a class in my Prism/CAL application which generates a form for users to fill in data. The form is defined by an XML file like this: <area idCode="general" title="General"> <column> <group title="Customer Data"> <field idCode="title" requiredStatus="true"> <label>title</label> ...

Get the parent listview from a gridview object

Hi, In the code-behind of a WPF application I have a variable containing a GridView. I know for sure that this GridView is the View of a ListView. Is there any way to get a reference to that ListView? Thanks ...

How to loop through WPF StackPanel static Items?

Probably very easy but I am having trouble to figure this out (also Google doesn't seem to help much). How can I loop through the statically declared elements (no databinding - elements are declared in the xaml) of a StackPanel? Any help appreciated! ...

Routing Key events to other control

Is there any standard way to route all Key events from the control A to other control B? I wish that the keyboard focus will still be on A however the event handler of A would trigger the all event handlers of B for the key events. edit: Clarification: calling a specific event handler I wrote for B is not enough. I need to mimic the act...

How can I set a breakpoint and have the code stop on a line inside an AttachedCommand?

In my XAML I have this command (which is an AttachedCommand which I got from http://marlongrech.wordpress.com): <TextBlock Text="Edit Test Customer"> <Commands:CommandBehaviorCollection.Behaviors> <Commands:BehaviorBinding Event="MouseLeftButtonDown" Command="{Binding ClickEditTestCustomer...