wpf

Design-Time Resourcedictionaries

I have created something like this and this. In effect I have a dll which supplies me with a "styler" for my application - it contains all my basic styles as well as a factory to call StylerFactory.DefaultStyler.ApplyStyles(this) on an Application - which merges the supplied ResourceDictionaries with the existing. This way I don't need a...

WPF Height Databinding question

I have an ScrollViewer that I am trying to do data binding on the height of. The ScrollViewer holds a long ListBox So here is my question. My ScrollViewer will bind to the height of my window (Name="MainForm") just fine. But then it is too long. If I try to bind to a grid in the window (Name="MainGrid") then the ScrollViewer expands...

Where to find Generic.xaml for native WPF controls?

Where to find Generic.xaml (or other code with the default look) for native WPF controls such as Button, CheckBox, TextBox, etc? ...

sketchflow project layout

I'm having a little trouble as I decide how to structure my projects. This question is slightly subjective, but I'm having trouble conceptually. If I create a wpf blend project (sketchflow right now), it creates two projects, "Project" and "ProjectScreens". Is this the best layout to use? The issue is, I have classes and code (networ...

Use of Attributes... INotifyPropertyChanged

This is just something I was thinking as I was learning on Attributes and I was using the INotifyPropertyChanged too much, is just and Idea and I would like to hear some opinios about it.( I know this would require some work on the compiler and not on the cosumer side) Since INotifyPropertyChanged is used with the same Pattern most of t...

WPF Dynamic Binding

Today, I was working on a WPF UserControl to display the current value of a few variables. I was wondering if there would be a way to make a super simple property grid in WPF. The problem is on the starred line of the XAML below. How would I bind a string to a property with an ItemTemplate like I have setup below? To be more clear ca...

DrawingVisual is not refreshed

I create my own FrameworkElement and override VisualChildrenCount{get;} and GetVisualChild(int index) by returning my own DrawingVisual instance. If I modify the content of the visual after initial rendering (e.g. in timer handler) using DrawingVisual.RenderOpen() and drawing into the context, the element is not refreshed. Here's the ...

WPF - Combobox with a Prompt

I'm looking for a way to add a "SELECT An Item" to a combobox that does not have an item selected. This would be different than a selected item as a default. I want the combobox to say "SELECT an Item" and be bound to one list for the possible selections and another model for the selected item. I'd prefer a style that I can apply to mu...

.net propertychange notification handlers - strings vs. expressions

Using WPF has made me a fan of INotifyPropertyChanged. I like to use a helper that takes an expression and returns the name as a string (see example code below). In lots of applications I see by very proficient programmers, however, I see code that handles the strings raw (see 2nd example below). By proficient I mean MVP types who know h...

VS Xaml designer error

Hi, I have an error with my Xaml files in a WPF application. I'm not able to see my control in the Visual Studio designer or in Blend. But, the application compiles and is running perfectly. In Blend, it says that there's an invalid Xaml and the error just make no sens at all, but when I close the control there's no more error. In Vi...

Can a WPF Browser Application run unsafe code?

I am writing some software that plots out fractals, and lets the user explore them interactively. I currently have my code in a windowed wpf app. I would like get into a browser hosted wpf app, so that I could display them on my website. The problem is that the code utilizes some "unsafe" code to do the rendering. I am using BitmapDa...

WPF client sided and Java server sided?

Hi, I would like to ask for some ideas regarding a scenario like this: 1) we need to build up a real time application that runs on a client. Some sort of stock trading functionality, updates pushed to few clients in different geo locations every 25 secs. 2) the data is collected and pre-processed on the server side (Glassfish/Java) We...

WPF Change Style's Brush Color

I have the following styles in WPF to draw and color a box, which is a custom control with various PART_Name items defined in a ResourceDictionary: <ResourceDictionary> . . . <Brush x:Key="BoxStroke">#FFD69436</Brush> <LinearGradientBrush x:Key="BoxBrush" StartPoint="0,0" EndPoint="0,1"> <LinearGradientBrush.GradientStops> ...

MVVM Command Routing Between Controls

I currently have a main View with a Button and a ContentPresenter which is bound to a property of the ViewModel which is another View (and associated ViewModel). Is there way to route a command from the a handler declared in the control loaded in the ContentPresenter? My reason for this is the main View contains the tool bar and the co...

DataTemplates in resource dictionaries don't inherit from app.xaml styles??

I added custom named styles to the app.xaml. I created an external resource dictionary (which I attach in the merged dictionaries of the app.xaml) and when I try to use one of the above named styles in the rcource dictionary, it says that there is no such style. Also the default styles (i.e. unnamed styles that apply for the entire app...

Looking for a Office 2007 Style zoom slider template

Has anyone seen a good template for a Office 2007 style zoom slider? As shown in this picture ...

DataTemplate.DataType=Collection<Entity> ?

Is there a way to create a data template that handles a list of items? I have Contact.Phones (EntityCollection) and I want the data template to handle the list - add remove edit etc. Is there a way to set the DataType property of the DataTemplate to generic EntityCollection? ...

Bind XDocument to WPF and still use XPath ?

This is a 2 part question. 1) Is it possible to bind XDocument to a WPF control without using ObjectDataProvider ? Here is a snippet of my code in which XmlDocument works, but i cannot use XDocument XmlDataProvider provider = new XmlDataProvider(); provider.XPath = "/Parent/Child"; provider.Document = mydoc; // xmldocument ...

3D globe rotation issues

Hi all, Im trying to get my 3D sphere to rotate when a user moves their mouse/finger over the sphere. I can get it to rotate no problems, but when I try to add inertia to the sphere using the Affine2DInertiaProcessor in the Surface SDK, I get jumping issues when I quickly flick the sphere, and I dont know why... Here is my initialisat...

How to create MS word like Symbol Insert dialog in WPF

Hi I am planning to create a insert symbol or alphabet dialog/window in WPF more or less like the one in MS Word. The window should list all fonts with subset dropdown. Anyone who can show me a way how to go about developing this. C# is preferable. ...