wpf

How to iterate over System.Windows.SystemParameters?

How can I iterate over System.Windows.SystemParameters and output all keys and values? I've found What is the best way to iterate over a Dictionary in C#?, but don't know how to adapt the code for SystemParameters. Perhaps you could also explain how I could have figured it out by myself; maybe by using Reflector. ...

.net message loop

Hi everyone. Could anyone help to explain how can I interact with message loop in WPF? I know how to start it using System.Windows.Threading.Dispatcher.Run() Now, I just need a way to call it. I have a while-loop and I whant to process messages in a message loop from it. while (state == DebuggerStaus.Waiting) { ...

WPF ObservableCollection CollectionView.CurrentChanged not firing.

Hi folks, I have a problem with one of my ICollectionViews. The ICollectionView's CurrentChanged event i not firing. Please see my code below. XAML: <!-- Publication --> <TextBlock Name="tbkPublication" Text="{x:Static abConst:Print.tbkPublicationText}" Grid.Row="0" Grid.Column="0" Margin="3" ></TextBlock> ...

Set text of a control of a child-window in WPF

How can i set a text of a textblock of a child window. childWindowname.textblockName.Text = "" doesn't have any effect. ...

Problem with loading resources from referenced assembly in Expression Blend

I have problem with loading resources for UserControl from referenced assembly in Expression Blend Here is the relevant code: <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/Referenced.Assembly;component/Resources/ResourceDic...

Downloadable WPF tutorial

Hello, I'm flying to New Zealand next week and figured that it would be a good chance to learn the basics of WPF. I've been flicking through this tutorial which seems really good but there is a lack of wifi in the stratosphere. Does any one know of a similar, easily downloadable tutorial for WPF or do I need to save all the pages on the...

WCF communication with several clients without IIS

Hey, we're working on a peer to peer comm software that would allow a number of grocery stores to sync their inventory with what we call "headquarters". To so this, we're thinking WCF+WPF, and no IIS and web services. My experience with WCF is basically zero, so my question is whether a TCP comm solution using WCF would work. The data th...

WPF Window.GetWindow(this) odd behaviour ?

I have a UserControl in a Window. During the lifespan of the application that Window is sometimes closed and when the user needs it again a new instance is made. At some point the user control needs to display a dialog, and needs to pass it's parent control to that dialog as the owner. Here's the catch. The first time the window is cre...

Static objects in wpf app.

In my wpf app i am using a lot of objects declared as static for caching purposes. Just wondering if there are any drawbacks. ...

How to use DataTemplates in Prism

I have been using Prism for a while now and enjoy how much easier it is to decouple my modules. This works especially great for views and view models since you can inject the view models via interfaces and the views via the region manager. Unfortunately this only works when my views are full blown user controls unless I'm missing somet...

Debugging WPF : Tools and Techniques

Ok, so I just wasted an hour hunting why my lookless WPF control wasn't showing up in the Window. Eventually, i traced it to the fact that I forgot to add the ResourceDictionary entry in the generic.xaml file under the themes directory. The style and the class itself was OK. Is there a way to trace what is going on inside WPF? How to ...

blurry wpf applications

Hi, I'm using win XP and recently since the last windows updates (at least that's the time that I noticed this happened) - 11.2.2010 - all WPF applications that I run are blurry. I first noticed on my own apps, they were suddenly blurry. I first thought if it wasn't something with the SnapsToDevicePixels property. But that was not the ...

How to position WPF Expander based on Header height?

Hi all! I have been struggling with a problem that at first glance might look easy for quite some time now. The problem in short is that I want to position an expander based on the height of the header in the expander. The long story is that I have a grid with (currently, but that could be easily changed) two rows. At the bottom at the...

Error creating an OpenGL control in a wpf window on windows 7

I have created an OpenGL control in C++ and wish to use this in a WPF application. I have successfully accomplished this and it works fine on Vista and XP machines but when I open my project on a windows 7 machine the WPF design window will not display. When I try to run the program I get the exception: "Cannot create instance of 'Win...

Open a wpf app from a console app and pass objects to it.

We would like to open a wpf app from a console app and pass objects which were initialized in the console app to the wpf app. Just wondering if this is possible. Thanks N ...

How to add buttons on different tabs using TabControl in WPF

I have the basic tabs made and I want each tab to have a different set of buttons, but the button is added to the main window and no the tab. When i go to the code and cut the button and paste it to the tab I want it to be, it works but only for 1 button, then for the second button I get an error message: "The object 'TabItem' already h...

Figure the arguments when wpf form is started using Process Class

We are using this code to launch a Wpf form: string fileName = @"C:\Test\bin\Debug\WpfTest.exe"; System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(fileName); psi.Arguments = entryZfName; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = psi;...

MVVM and the TextBox's SelectedText property.

Hi all. I have a TextBox with a ContextMenu in it. When the user right clicks inside the TextBox and chooses the appropriate MenuItem, I would like to grab the SelectedText in my viewmodel. I have not found a good way to do this the "MVVM" way. So far I have my appliction utilizing Josh Smith's way of MVVM. I am looking to tranfer...

XAML Styles - how to use BasedOn while overriding triggered setter

I'm using a XAML style to create a custom radio button using my own images. The style uses triggers to change the look of the button based on focus, pressed, etc. Here's the style: <Style x:Key="SmallButtonAsRadioButton" TargetType="RadioButton"> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="SnapsToDe...

SlimDX viewports in WPF controls

I am transitioning from WinForms/XNA to WPF/SlimDX because: a) all of the benefits of WPF over WinForms (but learning curve = ouch!) b) I would like to have multiple SlimDX viewports attached to Panels. XNA has 1 "game" screen. c, last and least) DirectX 10 support All of my previous XNA code is in C#. I am having trouble figurin...