wpf

Serializing WPF RichTextBox to XAML vs RTF

I have a RichTextBox and need to serialize its content to my database purely for storage purposes. It would appear that I have a choice between serializing as XAML or as RTF, and am wondering if there are any advantages to serializing to XAML over RTF, which I would consider as more "standard". In particular, am I losing any capability ...

Make ListView.ScrollIntoView Scroll the Item into the Center of the ListView (C#)

ListView.ScrollIntoView(object) currently finds an object in the ListView and scrolls to it. If you are positioned beneath the object you are scrolling to, it scrolls the object to the top row. If you are positioned above, it scrolls it into view at the bottom row. I'd like to have the item be scrolled right into the center of my list v...

WPF slow to start on x64 in .NET Framework 4.0

I've noticed that if I build my WPF application for Any CPU/x64, it takes MUCH longer to start (on the order of about 20 seconds) or to load new controls than it does if started on x86 (in release & debug modes, inside or outside of VS). This occurs with even the simplest WPF apps. The problem is discussed in this MSDN thread, but no ans...

Conditionally making readonly to WPF DataGridCell

Hi All, I have a situation that needs to conditionally make readonly to wpf datagrid cell. There is IsReadOnly property in DataGridCell. But unfortunately, that property is readonly! Is there any way to do it? ant. ...

WPF PIXELS DPI RESOLUTION

I am reading a book on WPF.As with all books, it gives an introduction on the problems the earlier display systems had with them.He refers to terms such as DPI, Pixels, Resolution etc.Is there any place where I can learn about them and about how they are related to each other ? ...

How to make the ChildWindow Fulscreen?

Hi , I have a ChildWindow , in which I have a Video Playing in Expression MediaPlayer. When I press the FullScreen Button then the whole Application switch to FullScreen Mode , but I want only the Child Window to be Full Screen. Thanks, Subhen ...

Is it possible for a WPF control to have an ActualWidth and ActualHeight if it has never been rendered?

I need a Viewport3D for the sole purpose of doing geometric calculations using Petzold.Media3D.ViewportInfo. I would prefer not to have to place it in a Window or otherwise render it. I'm attempting to accomplish this by instantiating a Viewport3D and setting a few properties using the following C# method: private Viewport3D CreateView...

WPF Image / Rendering Event

I am using an Image control to display documents: <Image x:Name="cImage" SnapsToDevicePixels="True" ... /> Because it takes about half a second to display the image on the screen I first display a preview with: RenderOptions.SetBitmapScalingMode(cImage, BitmapScalingMode.NearestNeighbor); cImage.Source=...; Then I set a timer to ch...

WPF binding and pointers

hey guys, I have a WPF application that contains windows with few user controls and Coordinator object. the window and all its user controls pointing to an object, which instace is in the Coordinator, by thier DataContext. the problem is that I want to change this object (e.g. create new object()) in the Coordinator but I want all the da...

WPF: VisualStateManager not working

Hi, I'm trying to figure out how the VisualStateManager works but I cannot do it. I want to do this: I have some TextBoxes where the user can enter his name, adress, ... and I'm doing a validation and I didn't want to do that with a validationrules-binding in XAML. I'm using MVVM-pattern and some code of my viewmodel does it. So I'm bi...

How do you make one line bold in a TreeView Class in WPF/C#?

How do you make one line bold in a TreeView Class in WPF/C#? I mean, how do you make just one line in a Tree View bold at runtime? ...

How do you add an Icon to a WPF App?

How do you add an Icon to a WPF App? I have an icon made already. How do I add it to the app so that it will represent the application on the desktop, in the minimize system bar, etc.. ...

Auto RowDefinitions Grid with ContentControls

Hi all, I have a Page with two ContentControls loaded by a RegionManager. A List of items, and a DetailView of these items. The problem is that the grid doesn't apply the auto height what I liked to. So I want to make all the available screen size to grid.row=0. I've added my code below: <Grid> <Grid.RowDefinitions> <RowDef...

Why FontStretch does not work in WPF?

I am trying setting FontStretch property on a TextBlock in WPF but it seems that it does not work. I tried Expanded, Condensed, etc. but the text appearance does not change. I am working on Windows XP with Framework 4.0 and tested both with Verdana and Arial. Does it work only on Windows 7 or only with some specific fonts? EDIT: If it...

Convert WPF application to Silverlight

Hello friends. I have WPF Application. Is it possible to quickly convert WPF app to Silvelight application, if not which technic I have to use to transform my WPF app to Silverlight. And also I want to know about limitations of Silvelight app. Thank you in advance. ...

WPF - Dynamically access a specific item of a collection in XAML

Hi, I have a data source ('SampleAppearanceDefinitions'), which holds a single collection ('Definitions'). Each item in the collection has several properties, including Color, which is what I'm interested in here. I want, in XAML, to display the Color of a particular item in the collection as text. I can do this just fine using this co...

Close current UserControl

I have a Window1.xaml main Window and after same event I display a UserControl EditFile.xaml The code behind is: public static int whichSelected = -1; private void button1_Click(object sender, RoutedEventArgs e) { //searchEditPanel.Children.Clear(); whichSelected = listViewFiles.SelectedIndex; searchEditPanel.Children.Add(_E...

How to style a text wrapping (hanging, like in MS Word) in the WPF TextBlock

I need to style a WPF TextBlock, like <TextBlock Text="- Test text text text text" TextWrapping="Wrap"/> that will show the - Test text text text text and not the - Test text text text text Do you know the solution of the problem? ...

Integrate Access report

How can I integrate Reports done in Microsoft Access in my WPF application? ...

Get the caret position when losing focus in WPF

I have two textbox's. I have an event setup for the "onLostFocus" of the textbox's. If i finish typing a word into both boxes one after the other all is well. At the point where i click back on the first textbox i want to click halfway through the word (perfectly resonable thing for a user to do). When the onLostFocus event fires her...