wpf

Validate data using DataAnnotations with WPF & Entity Framework?

Hello is thee any way to validate using Data Using DataAnnotations in WPF & Entity Framework? ...

Why can't I access a TextBox by Name with FindName()?

Why does FindName() return null in the following example? XAML: <Window x:Class="TestDynamicTextBox343.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <StackPanel> <Border > <D...

My WPF application closes at weird moments

Hi guys! I have a really weird thing happening in my wpf application. Every time I close something (a dialog box, a window, etc...) the ENTIRE application closes, instead of only the window/dialog which is beeing closed. This not only happens when I call the Close method directly, but also when the element closes on it's own, eg: when...

Handle DataGridHyperlinkColumn Click Event

How to handle click event of DataGridHyperlinkColumn programatically through code(in .xaml.cs file). ...

Improve drawingvisual render's speed

I create my own FrameworkElement and override VisualChildrenCount{get;} and GetVisualChild(int index) by returning my own DrawingVisual collection instance.I have override OnRender . I will add 20-50 DrawingVisuals in this FrameworkElement ,every DrawingVisual will have 2000 line segments.The logic value of these points between 0 to 600...

BeginEdit of a specific Cell from code behind

Is possibile begin edit of a specific cell from code behind with DataGrid control (WPF Toolkit)? I have to enable the celledittemplate of first cell of selected row after a button action...how can I do? ...

C#/WPF: Display Images like a LightBox in jQuery?

Hello, Did anyone ever try to create a jQuery "LightBox"-Like "Popup" (WPF UserControl) for displaying Images? See this page for an example: http://www.huddletogether.com/projects/lightbox2/ Thanks! ...

WPF: Grid layout - how can I get row and column of element with MouseMove or similar events, when cursor is over empty cell?

Hello, As I stated in title to this question - I have an WPF Grid based layout with two header rows and few empty ones. Grid has about 100 columns. I am trying to achieve the situation, in which I will be able to highlight the cell of empty row, when mouse is over it (and fire an event, when user will click this cell). I sketched my ...

Events with FlowDocumentPageViewer WPF

Hi, Needed some help. Is there are any events while we change the pages in the FlowDocumentPageViewer is there are any events while we zoomIn/zoomOut in the FlowDocumentPageViewer Best, Bala. ...

How can I access x:Name from Code Behind?

I have a datagrid in which I am using DataGridTemplateColumn and DataGridTextColumn. I want to access these columns at runtime so I have assigned x:Name property to them. But I was not getting that value in code behind, so I looked for DataGrid and then read objects by iterating through DataGrid.Columns. How can I read x:Name property fr...

Binding IsEnabled and other Properties to Public Properties, does it work like Dependency Properties?

In my scenario I have a lot of buttons or other controls which I want to depend upon a public property inside the code-behind file. Let's call this IsEverythingLoaded and it's a boolean. Now I would like to have a button look like this <Button Click="DoTheMagic" IsEnabled="{Binding Path=IsEverythingLoaded}">Click Me</Button> To...

Problem in Databinding to Image Source WPF

Hi all, I have some problem on databinding to Image's Source Property. I have a listview Template <Style x:Key="ListViewStyle" TargetType="{x:Type ListView}"> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderThickness" Va...

FlowDocumentPageViewer SearchText and Highlighting

Hello, I am creating a search and highlighting the text using the FlowDocumentPageViewer, something similar to the link given. http://kentb.blogspot.com/2009/06/search-and-highlight-text-in-arbitrary.html When I search for Tokens of string, (using a list of string) everything works fine and I get my rectangle applied appropriately. B...

WPF DataTemplate/ControlTemplate and VS2008 designer

Hi ! Suppose you have WPF Window composed of many elements that are using DataTemplates / ControlTemplates (ItemControls ... ) But you want to see how every DataTemplate looks like in VS Designer. What more, if you define a ControlTemplate from as a Template located in another file to be able to view it with the content. Something lik...

Architecture question - call a remote SQL Server directly or thru a service?

In my new WPF/silverlight app, is it better to directly connect to my remote SQL Server (I'm using linq to sql), or is it better to call a WCF service and have the service connect to the database? The SQL Server and a Win2k8 web server are both leased and at the same location. If creating a WCF service, I would run it on the web serve...

making a simple search function, making the cursor jump to (or highlight) the word that is searched for.

Dear community. I have now used way too long time, trying to figure out a problem, which I didn't think would be that hard. Here is the deal: I am writing a small application using C# and WPF. I have a RichTextBox containing a FlowDocument. I have added a small textbox and a button below my richtextbox. The user then types in the w...

How can I create a button which Rectangle object filled with a color in WPF with C#?

Hi All, How can I create Button control which contains a Rectangle object filled with the color represented by the Colors.Aqua? I have a rectangle Rectangle rectangle = new Rectangle(); rectangle.Fill = new SolidColorBrush(Colors.Aqua); rectangle.Width = 100; rectangle.Height = 50; and I have a button: Button button = new Button()...

Using RenderTargetBitmap on WindowsFormsHost

I have a set of controls inside a WindowsFormsHost and I would like to capture the current view and just save it as an image, I however only get some Panel visible in the Image. Is it possible to use the WindowsFormsHost as a "Visual" and capture the wrapped controls? See my example: <WindowsFormsHost x:Name="windowHost"> <wf:Pane...

notify all subcontrols in WPF with specific attributes

Hi there, how can i inform all subControls in WPF that they shall for example expand? Not every SubControl shall be informed.. only those who can e.g. accept an other element for drop. Perhaps you know another posibilty to let the items change their color when they do accept specific dropContent. Thanks, el ...

Trace.Assert not breaking, neither showing the message box

I have a WPF application in which I'm moving data around on a Canvas. The problem started when I tried moving the data with the mouse like a freak. Here's the sequence of the actions: The MouseMove on the Canvas is triggered In the MouseMove, I change some data A Trace.Assert FAILS. The debugger does not break, neither is the message...