wpf

WPF: Setting the DataGrid VirtualizationMode from its column

I have a data grid column that requires the VirtualizationMode to be "Standard", not "Recycling". Therefore I would like to set this property in the DataGrid automatically. The problem is that in the constructor of my column the DataGridOwner is not yet set (and is null) and in GenerateElement override it is too late for changing Virtua...

why setting ScrollViewer.CanContentScroll to false disable virtualization

as most wpf developers know, setting ScrollViewer.CanContentScroll to false will disable virtualization , but I'like to know how it works, because I try to enable virtualization while setting ScrollViewer.CanContentScroll is false . ...

Row Number In datagrid Control WPF

How can I display row number in the first cell of the datagrid control, I don't have the row number or any other information, just data from the data base and Some Value Some Other value and I want the output like First Some Value Secont Some Other Value How can I do that, any idea ...

Wpf CustomButton Toolbar Style

Hello, i have created a UserControl to make a ImageButton. But i replaced the the UserControl Item with a Button. < Button x:Class="myimagebutton" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:imagebutton"> <Grid x:Name="grdButton...

WPF : Use different icon images as an ImageBrush?

An Icon can contain more than one image. I want to use an icon for an ImageBrush and I want to set which image inside the icon should be use. But somehow it seems I can't do that. The brush always picks the largest image from the icon. Is there a way to choose the image manually? ...

WPF loading serialized image

Hi, In an app I need to serialize an image through a binarywriter, and to get it in an other app to display it. Here is a part of my "serialization" code : FileStream fs = new FileStream(file, FileMode.Create, FileAccess.Write); BinaryWriter bin = new BinaryWriter(fs); bin.Write((short)this.Animations.Count)...

WPF/RibbonGallery: Need help understanding binding and events

i need some help understanding the example posted by Lester's Blog: Using RibbonGallery Control. i am relatively new to WPF and not really familiar with MVVM i dont really understand how the ribbon gallery in the sample is bound and how to handle events like click/selection change to switch the font or color. ...

how can i get the parent of user control wpf

i have a problem i make a window application and using some Some Wpf user control on my Window Form i want to close my form When I close the user Control,Cancel button how can i achive it.....means i want to get the parent of usercontrol ...

WPF Animation - Why won't my image spin?

I've created a simple user control in WPF and added an image to it: <Image x:Name="logo" Source="/View/Images/Logo.png" Width="100" Height="100"> <Image.RenderTransform> <RotateTransform Angle="0" CenterX="50" CenterY="50" /> </Image.RenderTransform> </Image> I want that image to spin constantly and to fade in and out....

Enable application framework settings in WPF projects?

What it is the option Enable application framework that I found in Visual Studio under VB.NET WPF projects Application settings? I found it enabled by default and the "Shutdown mode" configured as "On last windows close". But for me is not really clear what does it mean that setting and also the other settings listed in that combo box. ...

WPF - Unit testing a custom markup extension

Hi, how would you recommend unit testing a custom markup extension in WPF? Presumably, I need to create an instance of my markup extension and call the ProvideValue method. However, this requires an IServiceProvider, which contains an IProvideValueTarget service. How would I generate this programmatically? ...

WPF: Textbox Binding with StringFormat={}{0:F2}. Don't show zero's.

I am binding an object to a TextBox with the following XAML: <TextBox Name="MyTextBox" Text="{Binding Path=MyValue, Mode=TwoWay, StringFormat={}{0:F2}}" /> Naturally when I bind a new object (which values are all still zero) the Text property is set to 0.00. I have several of these TextBoxes, which makes it tedious to delete every valu...

How can I force my busy indicator to display? (WPF)

I've created a busy indicator - basically an animation of a logo spinning. I've added it to a login window and bound the Visibility property to my viewmodel's BusyIndicatorVisibility property. When I click login, I want the spinner to appear whilst the login happens (it calls a web service to determine whether the login credentials are ...

Set Forecolor in my wpf listview for colum which has value as True..

Hi,,,here in my WPF application am using listview with 5 columns and one of the column has flag value and my requirement is, if the flag value is True then i have to set the forground of the row to RED color....Thank you ...

WPF DataGrid Bind Editor Setting to another property

I have a field in a DataGrid, bound to a value (Item.Amount), now inside the style for that field editor, i would like to bind the Format field to Item.QuantityDecimalPoints. But I cannot seem to be able to go up the tree to the same Item that the record is bound to. I have tried the following: Format="{Binding Path=QuantityDecimalPoi...

Tunnel and Bubble events in WPF

I have follwing grid: <Grid x:Name="LayoutRoot"> I want to handle MouseDown and MouseUp events both at Grid and Button level. How to do that? ...

App.XAML where are you!!?

I am new in WPF. Created a new WPF UserControl. See that some people uses an app.xaml file in order to set inside application level ressources. My solution consists of a WinForm and a WPF UserControl. I don't see somewhere any app.xaml file. How to proceed? ...

WPF: Binding DataGrid column header to ViewModel

I have a datagrid in which i manually specify the columns (AutoGenerateColumns="false"). I'm using MVVM and I would like to bind the column header (the text) so that I get it from my ViewModel. But I can't find a way to do that. The closest thing I've found is this: http://stackoverflow.com/questions/652240/wpf-toolkit-bind-datagrid-col...

What patter use in WPF dekstop app for login window and main application window?

First of all, we are in C#, WPF, desktop application (can be .NET 3.5). I need to show login window when application starts, if login succeeds, hide login window and show main app window. In addition, when the main window is closed, one should see login window again. If login window is closed, application quits. Bonus to make it harder...

How to generate WPF Form using T4 ?

Hello, One of our product requirement is to allow the generation of Search form. So we need to facilitate the user to generate the search form based on the selected data fields. Now our application is in WPF. Can anybody guide me how to start this thing. I have been told to research on T4, But any kind of help will be appreciated. Rega...