wpf

Drawing a seat area in wpf.Advice needed

Hi, New to wpf I am after some advice,pointers-articles-codesnippets that can help me to write a usercontrol containing a seating area Lets say a cinema has 200 seats and it a square. I need to be able to draw 200 seats . What is the best way to draw seats?Would you draw 200 rectangles? Any suggestions ...

WPF: Bind DataGrid to List<String>

Funny, how sometimes the simple things bite me in the behind. I can bind a DataGrid nicely to a Collection of some arbitrary class, using a DataGridTextColumn like this: // bound to List<Class> <DataGridTextColumn Header="Name" Binding="{Binding Name}"/> Now I want to bind a DataGrid to a simple Collection of String. So since there i...

WPF - RibbonControlLibrary not supported with Visual Studio 2010 ?

Hi guys, Today i licensed and downloaded the WPF RibbonControlsLibrary from Microsoft which is an extension to the WPF Toolkit. I've read some tutorials to implement an examlpe here When I tried the example is sadly noticed that in XAML i could not access the referenced library. xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.R...

Using Japanese characters in WPF/XAML

I want to display Japanese chars in my WPF application: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <Grid> <TextBlock Text="はい" FontSize="30" /> </Grid> </Window> ...

Null reference exception While Navigating to PlayListItem.

Hi, I am trying to play the selected media from PlayList,if the selected index is not zero as below: if (playList.Items.Count == 0) { setPlayList(); if (selectedIndex!= 0) { if(custMediaElement.Playlist!=null) custMediaElement.GoToPlaylistItem(selectedIndex); ...

WPF worker thread requires suspension by consumer notification

Hi I have a producer - consumer pattern. The WPF UI is sort of ancilliary to a long-running worker thread which is listening to packets and enqueing tasks. In practise all the messages are dequeued and then the UI consumer processes. The issue I have is that I have a UIcontroller class which is responsible for all WPF GUI components. It...

WPF datagrid template

Hi, I want to make a WPF datagrid look similar to the HTML grid in the following picture: http://img443.imageshack.us/img443/2563/saltoftheearth.jpg Does anyone know an easy way to do this ? Regards, S. ...

disabling a window

In my application I have a button. If the button is clicked as select against a database is executed and the result is shown in a ListView. As the select is quite complex, it takes some time to retrieve the data. When I click the Button, the Application-Window should be disabled until the data is loaded. But when I set the IsEnabled-Pro...

DataGrid validation of DataServices data - how??

Hi, I'm trying to display data from WcfDataService (VS2010) in WPF DataGrid. Everything works. except of normal validation. I was trying to make validation both with default WPF validation and IDataErrorInfo, but I can't get working all features I need. That is list of problems and questions: 1) How to disable DataGrid built-in check f...

WPF binding not updating until after another action

I have an observable collection bound to a listbox in WPF. One of the options in the window is to use an OpenFileDialog to add an item to the listbox with certain properties. When I use the OpenFileDialog it immeditaely sets two of the properties of the new item in the observable collection. I am using INotifyPropertyChanged to update th...

WPF - Get combobox checked property from ListBox

I have a listbox, which is defined like so: <ListBox ItemsSource="{Binding Source={x:Static local:ResourceCollection.resourceList}}" Height="143" HorizontalAlignment="Left" Margin="6,6,0,0" Name="assignmentLB" VerticalAlignment="Top" Width="287" FontSize="12" FontWeight="Normal" IsEnabled="True" Grid.Column="0"> <ListBox.ItemTemplat...

Can't find this.Controls - what am I missing?

Sorry for a potentially dumb question, I am still new at this. I really appreciate your help. Referring to http://stackoverflow.com/questions/1536739/c-get-control-by-name/1536756#1536756 But I don't have a "this.Controls" available. Is there something I am missing here? In other words, when I type "this." and visual studio populates ...

WPF app startup problems

My brain is all over the map trying to fully understand Unity right now. So I decided to just dive in and start adding it in a branch to see where it takes me. Surprisingly enough (or maybe not), I am stuck just getting my darn Application to load properly. It seems like the right way to do this is to override OnStartup in App.cs. I'...

Using a class initiated in one method in another method

I have a C# WPF app that every time the user opens a new file, the contents are displayed in a datagrid. public partial class MainWindow : Window { public TabControl tc = new TabControl(); public MainWindow() { InitializeComponents(); } private FromFile_click(object sender, RoutedEventArgs e) { ...

WPF Rectangle filled with horizontal or vertical lines

I am trying to create one rectangle filled with Horizontal or Vertical lines. The width of the rectangle is dynamic so I can not use an image brush. Please let me know if anybody knows any solution. ...

How does data binding avoid recursive update in WPF?

I am studying binding in WPF, then I have this question: let's say a dependency property is binded to a property of an object which implements INotifyPropertyChanged interface. when the binding target update the source, then the source's property get updated. since the property setter of the source object changed, it will in turn noti...

Silverlight 4 Toolkit Chart question

Silverlight Chart Legend Style With Silver Light 4 Tool Kit April 2010 Going off various examples I have found on the web, I am trying to set the legend style so the items are side by side. Error returned “cannot find Style Property ‘ItemsPanel’ on the type ‘System.Windows.Controls.DataVisulization.Legend’ <chartingToolkit:Chart.Legen...

wpf datagrid current item binding

I want to bind a content of a label to the selected item of a datagrid. I thought the 'current item' binding expression would work, but it is not. My xaml code and code-behind c# is like below. <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:/...

In WPF, how do I get a command in a Control Template to bind to a property in a parent?

I am relatively new to WPF and sometimes it makes my head explode. However, I do like the power behind it, especially when used with the MVVM model. I have a control template that contains a button. I use that control template inside of a custom control. I want to add a property on the custom control that will bind to the command proper...

WPF version of Application.OpenForms

I have an application in which I will have to get at another WPF window which is open. In WinForms, I was able to use: MainWindow main = (MainWindow)Application.OpenForms["MainWindow"]; To be able to access the the form. Now in WPF it does not exist. I have seen the other post on this site which is relevant, however it uses Applicatio...