wpf

MVVM toolkit (templates) and XAML powertoys for wpf mvvm work?

Hi there, I recently downloaded the MVVM toolkit on codeplex from WPF futures which basically has templates (although i can't seem to find many docs for it) for creating standard MVVM apps for WPF. I also came across the Powertoys for XAML which allows you to create ViewModels from classes etc.. Is this the best way to go? There seems...

How to refresh an ItemsSource with Silverlight 3?

I have a Silverlight 3 application which calls a traditional .NET Web Service (asmx) to get a list of records and then display it in a ListBox control (lstRecords.ItemsSource = myRecords). Any records could be added or updated or deleted at anytime and I would like my UI (records displayed in the ListBox control) to reflect the latest ch...

Dynamic control creation in WPF

I'm working on a project where I have some hierarchical data that I want to be able edit through a fancy WPF control. The data structure is essentially an expression tree. Each node can be a different Expression type but inheriting from the same base class. These different types need to have their own way of editing them. My thoughts ...

INotifyPropertyChanged and INotifyCollectionChanged in F# using WPF

I have an array of sample information that is constantly refreshed in a background thread. Currently I am constantly assigning this array to a datagrid's ItemsSource property using a DispatcherTimer. That works but it resets any visual locations, for instance if the user places his cursor in the middle of the datagrid the execution time...

Hello World [WPF]

I am trying to create my hello world windows app in WPF. What should I do to run this window? Class1.xaml <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> </...

MVVM - Where should I put code that dynamically generates and loads XAML?

Hi, I guess this is sort of a philosophical question, but I have some code that dynamically adds templated columns to a GridView by generating the XAML at runtime from Model data and loading it using XamlReader. My question is, In an MVVM world, where should I put the code that accomplishes this? At the moment, I have it in the codebehin...

Is there a better way to update UI Element with Dispatcher?

Hi guys I'm a newbie with WCF services, and I'm trying to figure out if is there a better way to update a WPF UI element (like a Label control) when I'm calling asynchronously my WCF service. Here's a piece of code: private void button1_Click(object sender, RoutedEventArgs e) { int result; CalculatorServiceCli...

Does Silverlight 3 have access to local file system, Open Excel, and print reports?

I was wondering if Silverlight 3 can be used to create line of business applications where I can use file import/export facilities, read an xls file and open Excel, use a report tool like Crsytal Reports or Reporting Services or.. is WPF needed? I am new to Silverlight and WPF and want to decide if I can skip learning WPF. I know Silver...

Alternatives to NativeWindow for subclassing

I am subclassing a Win32 window in managed code using NativeWindow. However, I'm encountering a bug in either my code or with NativeWindow that throws an exception when the parent is closed. The code I'm using is this: public partial class ThisAddIn { private VisioWindow visioWindow; private void ThisAddIn_Startup(object sender, S...

WPF ListView Show selected item

hi, i want to show the selected item in a list view automatically(it isn't possible to show all items without scrolling). this.listView.SelectedIndex = 999; selects of course an item, but it doesn't show it. what can i use to show it automatically ? kind regards, jeff ...

Customizing the BulletChrome element in WPF

I'm trying to customize the look of a checkbox in WPF. I was hoping I could grab the default control template for the BulletChrome class that's defined in PresentationFramework.Aero and work with that. However, BulletChrome is not a sublcass of Control, so there's no template to modify. Does anyone know I could do this? ...

Where can I find WPF Clip Art?

I'm looking for some simple clip art to use in a WPF application. I'd like it to be vector-based so it scales well, so obviously I would need to be able to convert it to XAML. Most of the clip art out there is raster graphics. My current method is to find a .wmf piece of clip art, paste it into Adobe Illustrator, copy it to the clipboa...

Writing a Color sARGB array to a WriteableBitmap

I have an two-dimensioanl array of sARGB colors (System.Windows.Media.Color) describing what I want to write in a WritableBitmap. The array is the same width and height than the expected bitmap. The problem is that, as long as I can see, the WritePixels Method of the WritableBitmap expects an array of integers. How do I convert my col...

Display hierarchical XML data using DataGrid

I have an XML file such as the one shown below <root> <child1> <grandchild1> <greatgrandchild1> </greatgrandchild1> <greatgrandchild2> </greatgrandchild2> ... </grandchild1> <grandchild2> </grandchild2> <grandchild3> </grandchild3> ... </child1> <child2> <grandchil...

How to draw line of ten thousands of points with WPF within 0.5 second?

I am writing WPF code to show a real-time plot which is a connected line containing about 10,000 points. It takes about 5 seconds to show a picture in my computer. Does anyone have an idea to make it quicker and within 0.5 second? class eee : FrameworkElement { public eee() { _children = new VisualCollection(this); ...

Xaml do not load UserControl from ViewModel object?

I have a Xaml code that should load my UserControl inside the TabControl. If I put this Xaml code: <DataTemplate x:Key="WorkspacesTemplate"> <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Gui}" ItemTemplate="{StaticResource ClosableTabItemTemplate}" Margin="4" /> </DataTemplate> I have absol...

Is it just me, or is WPF a mess of databinding and custom IValueConverters?

Seriously, it seems like every time I want to make my UI elements talk to each other, I end up coding a new, custom, IValueConverter :(. Someone tell me that I'm doing it wrong, please! Examples: I wanted a button to be enabled only if my textbox contained a valid URI. Great, time to code up a UriIsValidConverter! Oh oops, I also want...

Visual Design Application: WPF or WinForms(GDI)?

Hi, I have to develop an application with which my client will do visual design. By this I mean the graphical display and manipulation related entities. (Similar in principle to ERD, but obviously then again, completely different problem area) Think of Visual Studio which has a toolbox, each item has some properties etc. Items have cer...

Data binding a WPF ListBox in response to a WCF service invocation

Picture, if you will, a Visual Studio 2008 WPF application with a single window containing a ListBox. This application contains a method, outlined below, that binds the ListBox to the contents of a database table. This application also happens to implement a WFC service contract, hosting said WCF service. The data binding method below...

How can I assing the Caret to a Control in WPF

Need to make a new WPF control and give the Caret to it. In WINFORMS or previos Windows UI it was easy using the WIN API Caret functions, but now in WPF we don't have hwnd for each control so... is there a way to do it? ...