wpf

Silverlight 4.0: MultiDataTrigger

Is there a way just like multidatatrigger behavior of WPF also implemented in Silverlight 4.0? OR Another workaround which behaves like multidatatrigger? ...

Why is WPFToolkit DataGrid so slow when binding?

I have a very simple test application where I have two objects, each with a small collection of items. when I select an object I display its collection in a WPFToolkit DataGrid. The problem is there is a noticeable delay, such that if you press up/down keys to toggle selection between objects you can see it can't keep up. Why is the pe...

How to define descending sort order (in XAML) for DataGrid in SL/WPF?

In order to define column sorting the SortMemberPath can be used. But how can I define that this column shall be sorted descending? ...

WPF - Set dialog window position relative to main window?

I'm just creating my own AboutBox and I'm calling it using Window.ShowDialog() How do I get it to position relative to the main window, i.e. 20px from the top and centered. Thanks. ...

WPF DataGrid.RowValidationRules : allow a row with errors to be commited

I'm using DataGrid.RowValidationRules to display error messages in Row Details when the row is not valid. <c:DataGrid.RowValidationRules> <c:RowDataInfoValidationRule ValidationStep="UpdatedValue" /> </c:DataGridx.RowValidationRules> The model implements IDataErrorInfo and I'm using this ValidationRule: public class RowDataInfoV...

WPF Listbox - Empty List Display Message

Can anyone suggest the best way to display a Textblock (with a text such as "List Empty") so that it's visibility is bound to the Items.Count. I have tried the following code and can't get it to work, so think that I must be doing it wrong. <ListBox x:Name="lstItems" ItemsSource="{Binding ListItems}"> </ListBox> <T...

How reusable should ViewModel classes be?

I'm working on a WPF application, and I'm structuring it using the MVVM pattern. Initially I had an idea that the ViewModels should be reusable, but now I'm not too sure anymore. Should I be able to reuse my ViewModels if I need similar functionality for a WinForms application? Silverlight doesn't support all things WPF does - should...

Delay in the implementation of text change in Statusbar control

I have a function a time consuming operation that is done I want to start and end operations appear to be user (By statusbar control) But when performed function, both text executed at the end of function. (user can not sees "Start Operation ...") What solution do you recommend to me? private void btnUpdateDataBase_Click(object send...

WPF Error when implementing Login.xaml

I am getting the following exception: "Nullable object must have a value" Everything was working when I was using StartupURI="MainWindow.xaml" but I wanted to implement a login screen so I changed this to Startup="Application_Startup" and then created the following method in App.xaml.cs: private void Application_Startup...

WPF: Why all the love for the Grid control?

Seen various examples of WPF applications I've seen the use of the Grid control for almost anything, even simplest things with only 1 column or row. Also, the WPF templates start with an empty grid. For me, using StackPanel or DockPanel is less verbose and are better for maintenance (think adding a row later and having to add +1 to all...

WPF Toolkit Pie Chart Fill Values

I Fill my Pie Chart with Data (form observablehas -> dict) but everytime the chart gets new data, the pie fades out and fades in. I want the pie slices to change like here: http://silverlight.net/content/samples/sl2/toolkitcontrolsamples/run/default.html if you choose "Pie Series" and then look at "dynamic data items". ...

WPF: disable inheritance of properties

Hi! I would like to use a TabControl as the main navigation in the application I am working on. So I would like to make the font in the headers of the TabItems bigger and also give it another background-color. However, I do not want this to be inherited. For example, if I use this code: <TabControl FontSize="18pt"> <TabItem Header="T...

Unable to add item to dataset in Linq to SQL

I am having an issue adding an item to my dataset in Linq to SQL. I am using the exact same method in other tables with no problem. I suspect I know the problem but cannot find an answer (I also suspect all i really need is the right search term for Google). Please keep in mind this is a learning project (Although it is in use in a busin...

How do I stop property values from flowing down the element tree in xaml?

Hi Let's say I have some Control that has been disabled. It contains a bunch of elements, but I want one of those child elements to remain enabled. Something like this: <ContentControl IsEnabled="False"> <Border> <Button Content="Button" IsEnabled="True"/> </Border> </ContentControl> So in this example, the Button's ...

Using a WPF toolkit DatePicker as a parameter to an ObjectDataProvider used as an itemssource (cont)

Continuing from the original question, when the ObjectDataProvider binds from the specified Method, a number of BindingExceptions are raised similar to the following: System.Windows.Data Error: 39 : BindingExpression path error: 'xxx' property not found on 'object' ''Object' (HashCode=15292788)'. BindingExpression:Path=xxx; DataIte...

Selectable text in wpf

Hi I am trying to render a WPF window that has lots of labels, textboxes, textblocks which are binding to data. I want to be able to select by mouse all the data or part of the data on the window. Is there a simple way in WPF to do that? Should I use page instead of window? Thanks ...

pass Validation error to UI element in WPF?

I am using IDataErrorInfo to validate my data in a form in WPF. I have the validation implemented in my presenter. The actual validation is happening, but the XAML that's supposed to update the UI and set the style isn't happening. Here it is: <Style x:Key="textBoxInError" TargetType="{x:Type TextBox}"> <Style.Triggers>...

Why does my adorner not re-render when the element it's applied to changes?

In a UI I'm building, I want to adorn a panel whenever one of the controls in the panel has the focus. So I handle the IsKeyboardFocusWithinChanged event, and add an adorner to the element when it gains the focus and remove the adorner when it loses focus. This seems to work OK. The problem I'm having is that the adorner isn't getting...

WPF: Getting the scroll bar to work in a wrap panel within a list view with group data

Hi, basically what I am trying to achieve is to group data within a List view with an expanded set to false - so that basically all you see is the grouped name and count of items - nothing special and easy to work out. Now for the difficult part (I have spent all day trying different options to get this to work!) when the expander is e...

How to change format of DatePicker in Blend

Hi Guys, I currently have the DatePicker in my project but there are problems due to the need that I need a specific format to be returned, not the regional format. Anyway in VS I could manipulate the format to how I wanted but in Blend there is no option, can anyone help me out here? btw this isn't any custom style. Thanks. ...