wpf

Drawing 30fps chart in Windows Forms

I'd like to draw a high-framerate (30fps+) graph/chart in a Windows Forms app. How? Windows Forms gets TERRIBLE frame rates drawing a clear-background drawing over a window. (I come from the land of GNU, so I apologize if this is obvious.) ...

WPF: Passing an TabItem control to controller class

Hello, I'm using WPF and the Tab Control as my menu. This generate alot of code behind code because one file is controlling all the user actions. Then i was thinking that i could use a Controller class for every TabItem. I used it and it works, but dont like the outcome. I have to use the FindName() method on the TabItem that i pass to ...

Is it appropriate to cast ContentPresenter.Content to UIElement?

Are there any situations where the content of a ContentPresenter will be some object other than a UIElement? Given that the field is declared as object rather than a UIElement, it seems possible that there would be. However, I cannot think of any situations where it would be, or even if it would be valid. ContentPresenter presenter = Ge...

Disable a single wpf listbox item

Does anyone know if and how one can disable one or more listbox items in a wpf lisbox without disabling the entire listbox? Preferably I would have a DataTrigger which, when a certain Binding value is false, disables this item (make it impossible to select) while keeping other items in the same listbox active. <ListBox> <ListBox.Item...

Handle tilt left / right in WPF

How can I handle tilt left or tilt right mouse event in WPF? ...

WPF Data Binding and Data from SQL DataTable - need some ideas.

Hello, i have a lot of some WPF windows. On them i write some code, which binds UI controls and data, something like this: public class AddressWindow { public string AddressID { get; set; } public string Addr1 { get; set; } public string Addr2 { get; set; } public string ZIP { get; set; } ...

WPF Devexpress ComboBoxEdit Items

Hello, i use devexpress comboBoxEdit component in my WPF app. I assign values for it like this: private void Users1_Load() { DataTable dtCat = SqlHelper.GetTable("base_UserCategory_Select", new string[] { }); DataRow dr = dtCat.NewRow(); dr["UserCategoryID"] = 0; dr["CategoryName"] = "< All >"; dr["IsSystem"] = "Fals...

C#/WPF: Catch Routed Event (UIElement.PreviewKeyUp) from UserControl

Hello, I've a UserControl which contains a TextBox called myTextBox. This UserControl is placed in a MainWindow.xaml where I'm trying to catch the "UIElement.PreviewKeyUp". Now when debugging, I can see the "UserControl" as sender, not the TextBox. How can I check if the KeyEventArgs e (especially e.Key) were sent from the TextBox call...

How to store System.Windows.Controls.Image to local disk

Hi All, How can i store a System.Windows.Controls.Image to disk say at location: C:\data\1.jpg Thanks ...

How do I enable an element to paint outside its container?

I'm trying to get elements to render outside the bounds of their parent panel, in this case I'm using a stack panel. <StackPanel ClipToBounds="False" Width="200" Orientation="Horizontal" Height="50" Background="{DynamicResource TierBackground}"> <Rectangle ClipToBounds="False" VerticalAlignment="Bottom" Width="25" Height...

Centre the background of a TabControl in WPF

I'm trying to get an image to float unstreched in the middle of my TabControl. I started with the below XAML which stretches the image. <TabControl> <TabControl.Background> <ImageBrush ImageSource="/LogoTest;component/logo_final.png" /> </TabControl.Background> </TabControl> I've tried various approaches ...

Rendering sharp lines in WPF

Hi all, If I render the following: <Grid> <Canvas SnapsToDevicePixels="True"> <Path Fill="#FF000000" SnapsToDevicePixels="True" Data="M 0.00,0.00 L 2.50,0.00 0.00,10.00 " /> <Path Fill="#FF260014" SnapsToDevicePixels="True" Data="M 2.50,0.00 L 7.50,0.00 2.50,10.00 0.00,10.00 " /> <Canvas.RenderTransform> <ScaleTransform Scale...

Datatable update in different thread (WPF)

Hi, I have a Datatable assigned to a DataGrid in main thread. I am updating the same DataTable from two different thread classes. Although the rows gets updated successfully in DataGrid control, I get following execption: NotSupportedException thrown, with the message saying 'This type of CollectionView does not support chan...

Set ItemsSource of a ComboBox to an Array of Integers?

Set ItemsSource of a ComboBox to an Array of Integers? ...

WPF Show data from multiple DataContexts in ToolTip of ItemsControl

Hi, I am trying to display a tooltip for an item generated by an ItemsControl that needs to pull data from conceptually unrelated sources. For example, say I have an Item class as follows: public class Item { public string ItemDescription { get; set; } public string ItemName { get; set; } } I can display the Item within an It...

WPF ComboBox DropDown Placement

I have a ContentControl comprised from left to right of a Button, partition and a ComboBox. I want the ComboBox dropdown to line up with the left side of the control as opposed to the left side of the combobox. Can't seem to find docs on Relative placement, etc. Anyone dealt with this? TIA ...

Binding to a single element inside a CompositeCollection

I am trying to produce a list of servers for browsing on a network such that it produces a tree view which looks like this: -Local Server - Endpoint 1 - Endpoint 2 -Remote - <Double-click to add a server...> - Remote Server 1 - Endpoint 1 - Endpoint 2 - Remote Server 2 - Endpoint 1 - Endpoint 2 My ViewModel looks like...

Emulating ShowDialog functionality

I am writing an application (c# + wpf) where all modal style dialogs are implemented as a UserControl on top of a translucent grid covering the main window. This means there is only one window and it maintains the look and feel of all the firms applications. To show a message box, the syntax is as following: CustomMessageBox b = new C...

How can I know that a xaml is deprecated?

I was using the following xaml in wpf: <Style TargetType="{x:Type Border}"> <Setter Property="BitmapEffect"> <Setter.Value> <BitmapEffectGroup> <DropShadowBitmapEffect ShadowDepth="1"/> </BitmapEffectGroup> </Setter.Value> </Setter> </Style> When I discovered that DropShadowBitmapEffect is now deprecated in favour of Dro...

WPF Animation Not Playing

I have the following xaml to show a rotating ellipse: <Ellipse x:Name="ellipse" Stroke="{StaticResource _SpinnerGradientBrush}" StrokeThickness="20" RenderTransformOrigin="0.5,0.5" > <Ellipse.RenderTransform> <TransformGroup> <RotateTransform Angle="0" /> ...