wpf

Getting Snapshot Slows UI - Thread Needed?

I'm currently working on a WPF/C# application which is connected to an external camera. This application gets a snapshot from the camera, then does some analysis and displays it to the screen via a user interface. There are also many other UI elements on the interface (such as buttons, menus, and comboboxes). Right now, while the appl...

Draw lines and circles in WPF

I need to draw a graph like bus station schema: o-School----o-Church-------o-Police. So, simple line and circles. Also I need to zoom it. As I have VS 2010, I thought WPF(as I understood it uses vectorized graphics) should be the good canvas to start drawing. Is it possible, complicated, and what do you recommend for a WPF beginner. ...

WPF CommandParameter not updated when set in Context Menu

Hi, I have a wpf window with several text box controls. I need to apply a common style that would apply a context menu to each control and i have defined it globally as follows, <ContextMenu x:Key="textBoxMenu"> <Separator/> <MenuItem Header="Affirm" Command="{Binding Path=AffirmCommand}" ...

WPF ToolBar: How to arrange toolbars at design-time

I've got two Wpf ToolBars in a single ToolBarTray. How to make them fit on two rows? I noticed users can move them at run-time. Is there a way to get the same behavior at design-time without using two ToolBarTrays ? To sumarize, at startup, I want this: instead of that: Thanks ...

Windows 7 - WPF - Framework 3.5 - Content not displaying in developer or when running

Help. I seem to have broken WPF 3.5 on my development box. If I bring up VS2008 and create a new, blank WPF app, it does not display the designer. If fact, I can see the desktop wallpaper through VS 2008. If I run the app, I get a window with the same see-through properties. Plus if I drag the app window around, it leaves artifiacts...

WPF: Specify a language for built-in Command labels

I'm using the built-in ApplicationCommands to create a menu: <Menu DockPanel.Dock="Top"> <MenuItem Header="_Datei"> <MenuItem Command="ApplicationCommands.New" /> <MenuItem Command="ApplicationCommands.Open" /> <MenuItem Command="ApplicationCommands.Save" /> <MenuItem Command="ApplicationCommands.Save...

Replacing the Windows shell with a WPF app

Hi, I want to replace Windows 7 Shell (32 and 64 bit) with my WPF application which should work as a Shell. The goal is WPF application will launch my Kiosk application and provide few services. My questions are How do I replace the Windows 7 Shell by my WPF application ? Do I have to do something special in my WPF application code ...

WPF designer error states that it "Could not create an instance of type..." for my custom UserControl when a StaticResource is applied.

I have an interesting problem. I've created a WPF UserControl which contains a button using a template: <Button x:Name="btnStart" Template="{StaticResource RoundedGlassButton}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="4" Height="32" Background="DarkGreen" Foreground="White" Width="72" Content="Start" /> When I plac...

WPF application exits immediately when showing a dialog before startup

Update: I guess, what I need is to understand what is the "correct", "supported" way to show a dialog before application start in WPF. Here's the code: public partial class App : Application { [STAThread] public static void Main() { var app = new App(); app.InitializeComponent(); ...

WPF, resource image not correctly located

I have image in project added as resource, if I try to add it to my WPF project it always end up with Error 1 The file images\background.png is not part of the project or its 'Build Action' property is not set to 'Resource'. C:\Users\Martinek\Documents\My\Learning.Dot.Net\WPF.8\WPF.8\Window1.xaml 21 47 WPF.8 I also tried to reference...

WPF Change a label's display based upon a bound textbox contents change

I have a bound textbox and I need to change its associated display label to bold upon the presence of any content. I dont want to use javascript if at all possible. Thanks ...

replace "DynamicResource" with "StaticResource"

Hi everyone! To realize my application I have used a lot Blend3. When Blend3 wants to link a resource to another resource, it uses many times the link-type "DynamicResource". As I have understood (but I could have understood not well), the "Dynamic" links have sense only if I want to modify the links at runtime. In other cases they use m...

Changing Default Colors of WPFToolkit Chart Control

Does anyone know how to or found any good examples of explicitly setting the color of the data points series when using the WPFToolkit chart control? I would like to set this as a style in my XAML. ...

Accessing XAML object in codebehind(WPF)

Hi, I'm new in WPF I'm creating object in XAML like this <Window.Resources> <local:DataReceiver x:Key="request"> </local:DataReceiver> </Window.Resources> how can I call this objects method from codebehind? ...

Updating an Image UI property from a BackgroundWorker thread.

In a WPF application I'm writing, I have a TransformedBitmap property which is bound to an Image object on the UI. Whenever I change this property, the Image is updated (and thus the image being displayed to the screen is updated). In order to prevent the UI from freezing or becoming unresponsive whilst I retrieve the next image, I'm a...

WPF binding screentip with relative source

I was expecting the title of the screen tip to show "X" as well, but it is empty: <Fluent:Button x:Name="rbNewProject" Header="X"> <Fluent:Button.ToolTip> <Fluent:ScreenTip Title="{Binding Header, RelativeSource={RelativeSource FindAncestor, AncestorType=Fluent:Button}}"> </Fluent:ScreenTip> </Fluent:But...

WPF 4.0 TabControl with DataGrid view source unexpectantly changing.

I have a TabControl where each tab contains a DataGrid. When the user switches between tabs it seems that the DataGrid is created from scratch. I say this becuase of three things that I've noticed: the columns are automatticaly recreated, the current sorted column is lost, and selection is lost. I would love to be able to retain the cur...

NHibernate check for changed to prompt for save

I was wondering if there is any sort of functionality in NHibernate to check if changes have been made to an object sense it has been loaded that would require a write to the DB to save. I have some other pieces like currently selected elements and so forth that may change but if they do it makes no difference in terms of actual data. ...

Calling a Method of a UserControl in MVVM

I'm having an issue with calling a method on a UserControl. Hear me out: I have a UserControl someControl in SomeView.xaml SomeView.xaml's DataContext is SomeViewModel.cs I want to be able to call someControl.DoStuff() somehow, somewhere. DoStuff is not UI specific (I could have just called DoStuff from the code-behind of SomeView.Xaml...

How can I use NLog's RichTextBox Target in WPF application?

How can I use RichTextBox Target in WPF application? I don't want to have a separate window with log, I want all log messages to be outputted in richTextBox located in WPF dialog. I've tried to use WindowsFormsHost with RichTextBox box inside but that does not worked for me: NLog opened separate Windows Form anyway. ...