wpf

Silverlight TimePicker CurrentTime

Is there any way to remove the current time that shows when TimePicker have focus in Silverlight ? TimePicker : http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html Category : Input > TimePicker ...

ICommand.Execute(object parameter) on RoutedCommand

If I execute the explicitly implemented ICommand.Execute(object parameter) method on a RoutedCommand , the command is executed as expected. There must be logic within the RoutedCommand to resolve the position from where the command was executed. Maybe it’s done through StackTrace? Probably it's the same as calling RoutedCommand.Execu...

How to pass selected radio button in the next window and show that as selected in WPF?

I have a WPF Window with a datagrid dgSample. it has been bound to a list lstSample like this: dgSample.itemssource=lstSample; this datagrid also has a radio button column wherein i select one row by clicking on the radio button, and then, i can move to the next page after i click on the next button. On the next page, there is again t...

how to set background image on grid in wpf using C#

hello all i have a problem i want ot set the image of my grid through code behind is any body help me how can i achieve this. thanks in advance shashank ...

Reference to control inside a ControlTemplate

How do I, form my contructor in the code-behind get a reference to the OuterBorder control in the XAML below? <Window Template="{DynamicResource WindowTemplate}"> <Window.Resources> <ControlTemplate x:Key="WindowTemplate" TargetType="{x:Type Window}"> <AdornerDecorator> <Border Name="OuterBo...

Expand WPF tree view items via data binding to IsExpanded property

I populate a WPF tree view using data binding. Tree view items are not expanded by default. The items in the collection the tree view binds to implement an IsExpanded property. A tree view item binds its IsExpanded property to the IsExpanded property of an item in the collection. In an attempt to make a certain tree view item visible I...

WPF high performance drawing - should I group by brush color?

In Direct2D they recommend drawing similar things together, to avoid unnecessary GPU state changes. They also do some drawing operation reordering behind the scene just for that. I have to draw a lot of rectangles which can have one of two colors. I'm thinking of doing the drawing in two passes, one for the rectangles with the first col...

WPF TextBox lostfocus as attached property

I have a Grid with many TextBoxes and I want to call NotifyPropertyChanged() method to update some other controls everytime one of these TextBox-es changed the value = lost the focus (I don't want to use PropertyChanged as UpdateSourceTrigger) This is what I can do: <Grid TextBoxBase.TextChanged="My_TextChanged" > ... </Grid> I ne...

How do I change the Typography defaults in WPF?

When a WPF applications starts, it has some standard settings that are applied to determine how text and numbers will look. Is there any way for me to change these default settings programatically? For instance, the FontNumeralAlignment documentation on MSDN states that a value of "Normal" means that "Default numeral alignment is used"....

Updating entites in Dynamics CRM 4 through the CRM-webservice takes forever...

Im having some trouble with Dynamics CRM 4. Im trying to update prices and availability with the crm-service in a WPF-app but it takes forever. Up to half an hour with about 6000 products. Should it take so long? Can I do this in some other quicker way? QueryExpression query = new QueryExpression(); query.EntityName = EntityName.product...

Cancel - Wpf Application.Current.Shutdown()

hi, are there any ways to cancel Application.Current.Shutdown(); background: i played with mef a little bit and put some plugins to my main app. if any plugin call Application.Current.Shutdown(); my main app shutdown too and i got no chance to cancel this. are there any ways? ...

Can WPF Controls be re-used?

For example, I have created a button with a check mark drawn on it. I need to use it in a couple places in my window. <Button Width="25"> <!-- Draw a Green checkmark --> <Polyline Points="2,5,6,10,13,1" Stroke="Green" StrokeThickness="4" StrokeLineJoin="Round" StrokeStartLineCap="Round" StrokeEndLineCap="Round" /> </Button> ...

WPF element that dynamically creates (encapsulated) children at runtime

I want to create a WPF element that, at runtime, is in full control of its child elements -- adding and removing child UI when its properties change. Something a bit like what ItemsControl does when you modify its ItemsSource property, though in my case there'll only be one child. This will be a view container for MVVM -- when you give ...

Data Binding tutorials using Microsoft Expression Blend4 for WPF application

Hello All, I am new to to Microsoft Expression Blend 4 and WPF. I am not finding tutorials about Data Binding for XML and also for DBs. If you have any resources, please post the it. Thanks and regards Harsha ...

WPF WindowsFormsHost child property

Hi, Just wondering if hosting a WindowsFormsHost control in a WPF user control in the following way is a good practice or not: <DockPanel LastChildFill="True"> <WindowsFormsHost Name="myHost"> </WindowsFormsHost> </DockPanel> private class MyWPFUserControl:UserControl { private SomeControl Foreign...

Is there any workaround to apply more then one Effect on one UIElement in WPF?

Hi WPF Lovers, Is there any workaround to apply more then one Effect on one UIElement in WPF? e.g. <Button Content="Blurred (Radius=2)"> <Button.Effect> <BlurEffect Radius="2"></BlurEffect> </Button.Effect> ...

WPF ListView Row background color

I am working with MVVM and WPF. VM contains - an Observable collection of Task (where Task is a class that has public properties TaskId, TaskTime and TaskDetails) CurrentTaskId I can set background color of each rows by using one of the method below using ListView ItemContainerStyle Trigger OR using ListView ItemContainerStyleSe...

Empty WPF ListBox as Drop Target

I have a ListBox that is a drop target of items from other sources. Everything is working fine except in a particularly situation. When the ListBox has no Items I can only drop in the border of ListBox (I have a trigger so the Border is visible when dragging). To give a bigger drop area I set the MinHeight of the ListBox to 25. When d...

How do you use the GridView.GridViewStyleKey property to style a ListView?

The documention for the GridView.GridViewStyleKey says (emphasis by me): You can use this read-only static property in Extensible Application Markup Language (XAML) by assigning its static value to another property value. Specifically, this property's static value defines the resource key that is used to look up the default ListView ...

ImageSource dependency property on a user control - XAML value set throws

I've created a small user control consisting of a button whose content is an Image. I created an "ImageSource" dependency property on the user control in order to bind to it from the Image inside the button. However in the XAML where I placed an instance of my user control setting the property throws an error at runtime : <ctrl:ImageBu...