wpf

Modifying an observable collection bound to a ListBox

I've a collection in viewmodel binded to listbox. I want to hide a particular type from the collection. Here is the code: public ObservableCollection [YZModeModelView] YZModeModelView { return this.XModelVIew.YZModelViewCollection; } I want to a particular type of model view's from YZModelViewCollection. eg. ModelView's with prop...

how can i store value in button at runtime?

Hello all I have a problem i have some dynamic button.and i want to store integer value in that. and get that value on that click event of that button how can i achieve it thanks in advance shashank DataView dv = new DataView(dtCat, "PK_CATEGORY_ID IN(" + categoryIds.ToString() + "0)", "PK_CATEGORY_ID", DataViewRowState.CurrentRows)...

How to assign WPF resources to other resource tags

This is quite obscure, I may just be missing something extremely simple. Scenario 1 Lets say I create a gradient brush, like this in my <Window.Resources> section: <LinearGradientBrush x:Key="GridRowSelectedBackBrushGradient" StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="#404040" Offset="0.0" /> <GradientStop Color="#4...

How to access the DataTemplate of a DataObject that has the DataTemplate with DataType assigned?

Hi guys, I have a DataObject and a DataTemplate that has the DataType=x:Type DataObject. I have a ContentControl which has as Content the DataObject. On OnContentChanged() of that ContentControl I need to access smtg from the DataTemplate of the new Conten which is a DataObject. How can I do this? Inverse, If I have a UIObject and ...

TemplateBinding Height To owner height WPF

I want to set the height of the Template of the window to the owner height. Suppos if my main window has the 1280 and 1024 resolution then I want to get the 1024 height and set it to the border in the template. how can I access the main window height ? ...

WPF Ignoring ProgressBar Style

Following a problem in WPF 4 where the default ProgressBar template has an off-white highlight applied causing it to dull the foreground colour, I decided to extract the template and manually edit the values to white. After doing this, I put the template as a style in App.xaml for global use and the Visual Studio designer began to use i...

Compile error: 'The type or namespace name 'Runtime' does not exist in the namespace 'MyAppNamespace.System' (are you missing an assembly reference?)'

I am writing a WPF client that consumes services from an ASP web service (VS2010, .net 4.0). It was working just fine until yesterday when I suddenly get the above compiler error. Double-clicking on the error takes me to Reference.cs and highlights just about anything along the lines of: [System.Runtime.Serialization.DataMemberAttribute...

wrong font in a RichTextBox importing from .rtf

Hi all, I'm developing a microsoft surface application using expression blend+vs 2008. I have a RichTextBox that loads formatted text from an .rtf file. The text is formatted with uppecases, color, and specific font (helvetica-neue). When i load the text, it is displayed in the control with matching format (color and uppecase) but NOT...

Microsoft Surface: Adding IdentityTag to TagVisualizer shows a cross-hair. Why?

Hi, in my Surface application happens this: When I put an IdentityTag onto my TagVisualizer, a white cross-hair appears. This TagVisualizer adds no TagVisualization when adding a Tag, it just calls some methods in its "VisualizationAdded"-Event. In my other TagVisualizers before there were no cross-hair but they always had Visualization...

wpf interoperability extra buttons

Hi I'm developing an app that needs to have some backward compatibility. I have a form where I host the UserControl element. When i do that 2 extra buttons show from the middle of nowhere like navigation application. How to get rid off these? the gui was made in blend. Firstly i made a new project (WPF) and then i change it to WPF Us...

How not to include a Thumb in ListBoxItem selection

I have a collection of items. I am presenting the items in a WPF ListBox using DataTemplate. Part of the DataTemplate is a Thumb which is used for resizing and visually separating between items. The Thumb.Visibility is binded to a property of the item (for example, the last item doesn’t have a visible Thumb). The problem is that selecti...

What is the corresponding WPF .NET component to a JTable in Java Swing?

I have a small Java Swing application that I want to rewrite in WPF .NET. The application uses a JTable with an AbstractTableModel and a custom TableCellRenderer. I use my custom cell renderer to display the objects in two rows. What is the corresponding WPF .NET component to JTable? ...

Targetting DataTemplate for only on certain views

I have a DataTemplate inside a global/shared ResourceDictionary like this which targets a DataType: <DataTemplate DataType="{x:Type foo:Bar}"> <!-- My DataTemplate visual tree goes here... --> </DataTemplate> This DataTemplate replaces my all foo:Bar types on all my Views (UserControls/Windows). What I want to do is to apply this ...

XamDataGrid Collection Column

Is there a way to bind to a collection column in a XamDataGrid DataSource? What i am trying to do is to show all the items of the specific column collection in a single grid field. (using the appropriate templates). Hope it makes sense to you all. Let me know if you need me to clarify things a little bit more. ...

Creating static resource dictionary

Hi All, I've created a Resource Dictionary that I want to merge with multiple usercontrol xaml files. I want only one instance of this Resource Dictionary to be created. Any idea how to do this? Note: Merge should happen through xaml only and not through code. Thanks & Regards, Vishal ...

Close View From viewModel using MVVM or without ViewModel

Is there any way to close the view when user click on the close button (X) on the view or I just want to know something like ApplicationsCommand.close don't want to use IRequestCloseViewModel interface. thanks a lot ...

DataGrid SelectionChanged happens too often

Hey, Guys As I have a DataGrid as another DataGrid's RowDetailsTemplate, I've got a strage effekt. If I Change selection in my inner DataGrid, the SelectionChanged-Method in the outer Grid is automatically caled, too. I don't know why, but I would like to know, what I can do against this. Thx ...

How can i convert simple shape bitmap to vector ( geometry)

I would to know if it's possible to convert a simple bitmap to a geometry object ...

GetAdornerLayer mysteriously returning null

I've been using the same bit of code for several versions of my app with no problems, but I'm now mysteriously receiving NullRerefenceExceptions with the following: this.Loaded += delegate { deleteBrush = new DeleteBrushAdorner( background ); AdornerLayer al = AdornerLayer.GetAdornerLayer( background ); al.Add( deleteBrush )...

Binding update adds news series to WPF Toolkit chart (instead of replacing/updating series)

I'm currently recoding a bar chart in my app to make use of the Chart class in the WPF Toolkit. Using MVVM, I'm binding the ItemsSource of a ColumnSeries in my chart to a property on my viewmodel. Here's the relevant XAML: <charting:Chart> <charting:ColumnSeries ItemsSource="{Binding ScoreDistribution.ClassScores}" ...