wpf

MediaElement issue in WPF

Hello all, I have 3 treeviews which looked like this: 1. Header 1 2. Header 2 a) sub header 1 b) sub header 2 3. Header 3 a) sub header 1 b) sub header 2 So I have three images which already at there. So when I mouse over on 1. Header 1 it will highlight my 1. Header 1 and also opacity my image. So ...

WPF: How to identify specific 3D models in the Viewport3D control

Hello, I am writing a program that needs to display a very simple 3D scene. Models are added and removed from the scene based on the user's interaction with the GUI. Right now, I can add models just fine. My problem is with removal. None of the 3D model classes involved (MeshGeometry3D, GeometryModel3D, Model3DGroup, and ModelVisual3D...

How to avoid selection of menu item

Hi I have expander and menu item in my project wpf, when the user select a particular menu item the items background color is set as blue and also when the mouseover an item its background color becomes as blue... How i could avoid those two features.. i want a expander with menu item without those features.. how to do this please help ...

MVVM setting default values

Hi, I'm sure this is a pretty common scenario, and I would like to know how MVVM developers tackle this. I have a ViewModel that is instantiated on demand, and persists until it is explicitly removed by the user. It's corresponding View is loaded onto the UI on demand. The View is able to unload and it's ViewModel may still exists in t...

Finding controls in listboxitem by sender

Hi, I currently have (in C# WPF) a listbox with each item containing controls, among them a button and a progressbar. Now what I want to do, is the following: Button mybutton = (Button)sender; I want to retrieve the progressbar that is in the same listboxitem as my sender button. How do I acces that control? Do I use the visualtreehe...

Trigger on Image inside a Button WPF

I want to control the visibility of the image in a button, via a trigger: <Button x:Name="NotesPanel" Command="{Binding AddDocument}"> <Image x:Name="notesImage" Source="Notes.png" Height="32"></Image> </Button> 1/Should the trigger appear in the button or in container that countains the button ? 2/How to set the visibility of the...

High-Performance UI Framework for .NET

My current task is to develop a software for measurement and testing purposes which will communicate with various devices. Because i have to assume that there will be a high amount of data transferred from the devices that needs to be displayed in some plotting component or similar, the UI framework used should be as fast and responsive ...

Render WriteableBitmap in WPF.

Hi there, I have noticed a bizzare situation - in SIlverlight, when a picture is rendered using WriteableBitmap Render method, the resulting pic is very sharp. Of course in WPF Render method is not available. I have used DrawingGroup to render two images on top of each other (I have got a png with transparency and standard JPEG). Howeve...

Converter stops filter working

I am trying to display filenames in a listbox, retrieved from a particular directory. They are stored in an ObservableCollection of FileInfo objects: public ObservableCollection<FileInfo> ProjectFiles { get { if (SelectedFolder == null) return null; DirectoryInfo d= new DirectoryInfo(SelectedFolder); if...

Getting a GridView to select the row on click (not just clicking on the text)

We want to select a row on a mouseclick anywhere in that row. Currently the user has to click the text in the row to select the row. This is our ListView inside a Grid, with a GridView inside it: <ListView Grid.Row="1" x:Name="lvUsers" PreviewMouseDoubleClick="lvUsers_PreviewMouseDoubleClick" IsSynchro...

Override ControlTemplate - not Style

I'm overriding the Content of a Button. My problem is that the default style of the button gets overridden when I do this. How can I keep the old style (the old style defines mouseover, mouseout effects and the like)? This is my code: <Fluent:DropDownButton SizeDefinition="Small"> ...

WPF - Maintain Group Style in ListView

I've got a simple ListView which pulls data from an ObservableCollection and I'm using a CollectionViewSource to a set a GroupPropertyDescription so that my rows appear grouped. I've used the following style to use an expander for each group: <Style TargetType="{x:Type GroupItem}" x:Key="listViewGroupStyle"> <Setter Property="Margin...

Silver/WPF remove mouse events, but allow touch events

Do any1 know how to remove mouse event, but allow only touch events. In brief, I have 2 monitors. 1 is the primary display, another is a touch screen. I don't want the mouse cursor to move over to the second display. For the display, it will only accept touch events, so hopefully, when the 2nd screen is touched, the mouse should stay ...

Printing Dynamic Usercontrol via document paginator in WPF : Datagrid is printed empty

Hi, I am trying to print a wpf document. I am using documentpaginator for pagination and a user control to create actual visual to print. My user control has few textboxes and a datagrid binded to data objects which are passed to the user control at runtime. Now the code works great when printing to an XPS document but when it prints t...

DatePicker day colors WPF 4

I have the following style for the text block in the dictionary <Style TargetType="{x:Type TextBlock}"> <Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Margin" Value="5,0,0,0 "/> <Setter Property="Foreground" Value="White" /> </Style> after...

How can I find all controls within a control(WPF, C#)?

I found interesting questions about this like in http://stackoverflow.com/questions/636383/wpf-ways-to-find-controls, but I just want my method to return all controls within it. It doesn´t matter the control´s name or its type as long as the method returns all possible controls he can find. ...

WPF lengthy Validation Scenario

Hi, in my scenario I have a Linq2SQL Data backend. my Dataobjects implement IDataErrorInfo to catch errors like Name==null (fast to execute Validationrules that only require the value, nothing special so far ) the Dataobjects are organized in a tree-structure, so each has a Parent and Children How can I validate if a chosen Name is U...

What is your strategy on implementation of Visual Inheritance In MVVM?

Hi, I want to write a Detail(Info) screen with MVVM pattern on my framework. There will be a base detail view model and view which has a toolbar and buttons on this toolbar(save, delete, new buttons, etc.). And users of this framework are going tor write his/her detail(info) screens without using manually added toolbar. Their detail(inf...

C# WPF: Display child nodes of selected parent node as a grid

I have a xml like this: <root> <project name="p1"> <row field1="31" field2="3" Name="Joe"/> <row field1="39" field2="3" Name="Joey"/> <row field1="37" field2="3" Name="Joei"/> </project> <project name="p2"> <row field1="31" field2="3" Name="Joe"/> <row field1="39" field2="3" Name="Joey"/> </project> </root> Now the listbox dis...

WPF Menu arrow on the first level

Help me please with wpf menu. I want the arrows showing that a menu item has also subitems. By default these arrows get placed beginning on the second level. but I want them to be shown on the first level also. I don't clearly understand what to change and how. Although I found <Trigger Property="Role" Value="SubmenuItem"> inside ...