wpf

WPF ItemsControl IsMouseOver not working as expected.

I have the following code in the Window.Resources of a WPF window. What it is basically doing is creating an item that represents a grid with a label positioned on the left and a button on the right. When I mouse over the label or the button the row changes color as expected but I want it to also change color if the mouse is over any o...

How do I make a log of my application?

How can I make a log of my application? Like maybe when an error is catched, it emails the user a log file? Maybe something like this? ...

How to synchronize column widths between two nested datagrids?

I have a wpf toolkit datagrid with a few columns, then inside the row details I have another datagrid. Basically I am emulating a treelistview control (example: http://www.codeproject.com/KB/list/treelistview.aspx) but using datagrids. I would like to sync the column widths of the datagrid in the row details with the column widths of th...

resolution in WPF

Hi, In my applcaiton,i make Grid of size Grid Width="1300.441" Height="80", Its working fien in this resolution.But when i changed my resolution to 1152 width,quater of application get out of the desktop. How can i avoid that? I want to display full page in all resolution. Pls help me ...

Report viewer in wpf and selection formula

I have a WPF application that I would like to present SQL Server Reporting Services sql 2008 reports in. I understand we have to use host widow control and then in report viewer control. I want to use remote processing mode. My code sample is : I have added namespaces: using System.Windows.Forms; using System.Windows.Forms.Integration;...

Smooth animation using MatrixTransform?

I'm trying to do an Matrix animation where I both scale and transpose a canvas at the same time. The only approach I found was using a MatrixTransform and MatrixAnimationUsingKeyFrames. Since there doesnt seem to be any interpolation for matrices built in (only for path/rotate) it seems the only choice is to try and build the interpolati...

MVVM (with WPF) - Binding Multiple Views to the Same ViewModel

I have recently started investigating the MVVM pattern with WPF for an upcoming project. I started with Josh Smith's MSDN article. I have a question (well many, but let's start with one): I have an IndividualViewModel which exposes the properties of the model. I need two views "Add Individual" and "Edit Individual" which are very simila...

WPF UI not responsive in spite of process running in a seperate thread. Why?

Using threading in WPF makes no difference for me. The UI continues to be not responsive. This is my code: private void button1_Click_1(object sender, RoutedEventArgs e) { Thread th = new Thread(new ThreadStart(LoadImages)); th.Start(); } void LoadImages() { this.Dispatcher.Invoke(DispatcherPriority.Normal, new System.Wind...

My application won't launch giving me some random error error when I haven't touched anything.

I'm having trouble debugging my application because I can't even run it. I haven't changed anything only added a picture to a folder in my solution explorer and now I can't even press F5 to debug it. Here's the error: System.Windows.Markup.XamlParseException was unhandled Message=" Can't create instance of 'MainWindow' in the as...

Set property category for WPF custom control?

In WinForms, I could add a [Category] attribute to a custom control property to specify which property category should contain the property. How do I do that in WPF? Thanks ...

Which 3rd-party UI libraries for WinForms, WPF, MVC, etc. are best?

I work with many diverse technologies, and don't possess the time to evaluate every single UI framework, so I'd appreciate hearing other coders' experiences with various frameworks. The stuff I've worked with so far (and my perceptions): WinForms: DevExpress (love the looks, hate the API and bloat), Krypton (free!, looks good, but lim...

how to get base uri of referencing xaml in a custom control

I have an custom control, which has an Image element with its Source property exposed to user, like this <ControlTemplate> <Image x:Name="PART_Image" Source="{Binding ImageUri, RelativeSource={RelativeSource TemplatedParent}}"/> </ControlTemplate> where ImageUri is an property in the control class, like this public Uri ImageUri {...

Layer two BitmapImage's in WPF

Hello, I have two instances of BitmapImage. I would like to layer then on eachother the create a new BitmapImage. How would I do this? (Using C#) Thanks! ...

WPF LINQ DataContext Refresh not reading new records in the sql database table

I have a LINQ datacontext and a ObservableCollection holding records for a Companys table in SQL Changes to the current records and new records made to the current datacontext (DataDC) are reflected when I do a DataDC.SubmitChanges(); However if I have another Window with a separate DataContext to the same tables, if I modify fields...

WPF: dependency property with type of Template - where to get default template (to set as default value)?

Hi, I am subclassing an ItemsControl (let's call it EnhancedItemsControl), and I would like to expose ScrollViewerTemplate dependency property, which would allow the user to optionally specify his own template for used ScrollViewer. I am doing it like this: public ControlTemplate ScrollViewerTemplate { get { return (ControlTemplate)G...

Why is DataGrid "Auto" width so huge all the sudden?

I have been working on an app with a datagrid from the wpf toolkit and the width was not specified in the xaml (default to auto), and it was working fine. It would extend the window width as I resized the window. However, all the sudden the "auto" width is massive and I don't know why. When I pull the xaml file up in blend it shows auto ...

Parent Child Relationship UI

Consider the following Parent/Child relationship. What I would like to know is how I would go about creating a GUI for this with the following requirements: All Parents or children will contain an image a label and a couple of buttons Parents will be collapse able New Parents/Children can be added at any time I was thinking about us...

WPF / XAML - Can text be auto sized?

For a fixed size wrappable text area, is there any way to make the font size as large as possible based on the amount of text? For example, if you have a 500x500 area with the text "Hello", the font size would be really big. But if you have a paragraph of text the font size would be smaller to fit into the area. I have looked at Viewb...

Generating thumbnail images in WPF

How do I generate a thumbnail image in WPF in the following scenario? using (MemoryStream mem = new MemoryStream(imgbytes)) { BitmapImage jpgimage = new BitmapImage(); jpgimage.BeginInit(); jpgimage.CacheOption = BitmapCacheOption.OnLoad; jpgimage.Stre...

WPF FlowDocumentReader and FlowDocument Screen Reader (NVDA) Acccessibility

I am using a FlowDocumentReader to display FlowDocuments in a .NET 3.5 WPF application (the FlowDocuments have help/info/notes that are displayed based on user choices in the ui). I assumed that the FlowDocumentReader contents would be read/recognized by a Screen Reader (I am testing with NVDA on Windows 7) - but when the reader gets fo...