wpf

store bitmap image in Xaml..

I need to store the bitmap image information in Xaml formated file. Can any one pls help me out on this regard? Thanks in advance. Ravi Naik ...

MVC best practice for *this* application in wpf?

Hi all What is the best practice for connecting a single data class which houses all information and communication to a UI coded in XAML? I am of course talking about the controller in MVC. This one class, call it Manager, exposes certain functionality such as Login() and GetNetData() etc. The UI is entirely in XAML, so it seems easy to...

wpf: Selecting the Text in TextBox with IsReadOnly = true ?

Hi ! I have this TextBox. This TextBox is located in DataTemplate: <DataTemplate x:Key="myTemplate"> <TextBox Text="{Binding Path=FullValue, Mode=TwoWay}" IsEnabled="False" /> ... and I want to allow User to select the whole text inside it (optionally by clicking on the Textbox). And I don't want to use any code behind. ...

How to have style applied for wpf datagrid row

Hi, I am Having requirement on WPF Datagrid row,Whenever user selects a DatagridRow,corresponding datagrid Cells borders should have thickness of 1 or 2 . or Provide margin for textboxes/Textblocks within in DatagridCell. With regards, Mahens ...

WPF - Animating gridlength in XAML

Hi, I was just wondering if it's possible to animate the height of a grid using purely XAML? I looked at this tutorial: http://windowsclient.net/learn/video.aspx?v=70654 But it seems as though one need to write custom functions for this to work. Can it be done just by XAML purely? ...

Why does my Moq IEventAggregator verification fail?

I use Composite WPF(Prism) and I am trying to unit test that my Controller does in fact subscribe to a Composite Event. My subscription code looks as follows... //Init Events. this.eventAggregator.GetEvent<PlantTreeNodeSelectedEvent>().Subscribe( ShowNodeDetails, ThreadOption.UIThread); My unit testing code looks as follows (I us...

WPF ComboBox update source question

I have a ComboBox with country codes and phone numbers (+43.., ..) The ItemsSource is a list of Country objects with many properties (Code is one of them.) The DataContext in which the ComboBox is located is an object with the PhoneNumber property. When user selects a country in the list, I want to update the source PhoneNumber Property...

Circular Gradient and WPF

I need to replicate a circular (or angle) gradient from a Photoshop comp in WPF; so far I can only find linear and radial. Does anyone know if such a thing exists, or and easy way to get get a circular gradient in WPF? Note: I'm not asking about a radial gradient. A circular gradient is like taking a rectangle, applying a gradient and t...

How to assign a dynamic imagebrush resource to a stackpanel's background in code?

I currently define the background for a user control like this: <UserControl.Background> <ImageBrush ImageSource="{DynamicResource LeftMenuBackgroundImage}" /> </UserControl.Background> How can I move this to code-behind, e.g.: PSEUDO-CODE: StackPanel sp = new StackPanel(); sp.Background = new ImageBrush(DynamicResource.GetResou...

Does anyone know what is the most up-to-date status of WPF source code reference?

Hi folks. Does anyone know what is the status of it now? There is a very sad post about it here, but I am wondering if anyone has some good news about it. Advices on how to go back to the last version of .NET 3.5 with valid WPF sources without screwing the complete system will be accepted with gratitude. Thanks. ...

Displaying an XPS document in Document Viewer

Hi Guys, I'm having a go with document viewer and XPS atm as I haven't tried it before. So I have a simple piece of code loading an XPS document and displaying it in the document viewer, however the document doesn't appear. The document viewer loads and a quick step through in debug mode tells me the information is there,it just won't s...

WPF, passing variable to converter inside data template

Hi, I assume this is possible but not sure how to do it. I need to pass the value of a class level variable to a converter, from within side a data template. <DataTemplate x:Key="ResponseItemTemplate"> <StackPanel Orientation="Horizontal" > <StackPanel.Visibility> <MultiBinding Converter="{StaticReso...

WPF ComboBox with empty item?

Hi! Suppose we have a DataSource bind to a collection from Database. There is no null item of course. How to add a void item into a ComboBox, so that at first load user would see an empty string. I don't want to add a dummy/void object into the Collection. Optimally in XAML. Any proposals? ...

Is there a way to know which item has the focus in a WPF application?

I there a way to know which item has the focus in and WPF application? Is there a way to monitor all events and methods calls in wpf? ...

Why is CompositeCollection not Freezable?

I am writing an application using the MVVM pattern. I am providing data to my view by setting my view's DataContext property to an instance of my ViewModel. Generally I just use Binding from there and go about my way. Recently, I tried to implement a ComboBox with an "extra" element beyond the collection my ViewModel provides that say...

Data Trigger Will Not Fire

I have the following Data Trigger set-up on a Control Template <DataTrigger Binding="{Binding Path=IsDragged}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard Storyboard="{StaticResource Active}" /> </DataTrigger.EnterActions> <DataTrigger.ExitActions> <BeginStoryboard Storyboard="{Stat...

WPF Pixels to desktop pixels

I've been linked in the past to this response to a similar question on converting WPF pixel coordinates to desktop ones, however I'm not sure I understand the maths involved. Astonish' answer states that "Pixels per WPF Unit = ConstantWPFUnit size * monitor DPI;" and that "The constant WPF unit size is 1/96." In my case, I've taken the...

WPF and routed event

I have a WPF window, which has a button that is inside a stackPanel, which is inside another stackPanel I wrote an event handler for the button for the MouseDown event. I want to execute this eventHandler three times for the button and the parent (stack panel) and the parent's parent How can I achieve that with the routed event, by wri...

Getting at the "parent" of a databound object?

Hi, I have an object with two arrays of strings. The object is data bound to a listbox. One list is bound as the list's ItemsSource. The other, which is the thing causing me trouble, needs to be bound to a combobox that's part of a DataTemplate that is set to the list's ItemTemplate. Basically each item on the listbox has the correspond...

Dynamic Datatemplate in WPF

Hi, I have a requirement that based on the User who logged in to my application I need to show a different view. How can I achieve this using datatemplates? Thanks, Jithu ...