wpf

How to format a string displayed in a MessageBox in C#?

I want to display a string in a message box with a following format: Machine : TestMachine User : UserName I am doing this: string strMsg = "Machine :" + "TestMahine" + "\r\n" + "User :" + "UserName"; MessageBox.Show(strMsg); When I do this the message box do not display a string as formated above. Colon...

Is there a way to set textblocks to static on a UserControl in C# before compile?

EDIT: Apparently I was a little confusing. The original post will remain below, but the main thing I'm asking is if there is a way to make a textblock on a usercontrol static, so that when I try to set it's value with a static method, it doesn't whine and say "An object reference is required for the non-static field, method, or property ...

Wpf set segments on video track

Hi all, I'm trying to make a player that user can click on the slider and mark a segment. The segment should be appear at different color. Also, there should be tiny button on both sides of segment, so the user can click on them to cancel/change it's position. Can you recommend me how to achieve this targets ? How to place the tiny but...

WPF: Dynamically created text with clickable links in it via binding

Hi, I do want to create a listview which consists of many items of an own class. One of the properties is a text which can contain one or more links in it. Normally I use a textblock with a binding on Text to get this content displayed. Now I do want those text being parsed for links and then dynamically make those links clickable. I f...

Databound WPF ComboBox with 'New...' item

Hi all I have a combobox which is databound to a list of elements. But in addition to that list of elements, i want to have another item. This item should display the text 'New...' The idea is if they select one of the normal elements, it performs some action involving that element. If they select the 'New' element, it will take them to ...

Access 2d array with point in wpf C#

Hi, I have a 2d array of a class. The size of array is very large (around 3000*3000) and accessing the array with ordinary row and column method is taking very much time. For this purpose, I want to use pointers to access the array. Following is my array code: Class definition: Class BoxData { Size _bound; bool _isFilled=fa...

Silverlight UI not unsubscribing from PropertyChanged events

I have a data bound UI. When I change the underlying data the UI updates fine but the controls appear to remain subscribed to my PropertyChanged events. I have the following: An ItemsControl bound to ListA Each item ListA contains a sub list ListB that is displayed using another ItemsControl Each item ListB is displayed using a TextB...

WPF: Add a dropshadow effect to an element from code-behind

I thought this would be something simple but so far i found nothing. How do you do it? ...

MVVM ViewModel and static methods

Hi everybody! I try to rewrite my Application using the MVVM pattern. I have a window to show related documents for different objects with static methods like this: public partial class ShowRelatedDocuments : Window { private ShowRelatedDocuments() { InitializeComponent(); } public static void ShowRe...

Using IDataErrorInfo or any similar pattern for propagating error messages

Hi all, I apologise for this question as it is rather fuzzy and there are several questions integrated but as they are so closely related I did not want to break them apart into several submissions. I am currently thinking about how to test for configuration errors in an application. There are different options available and one whic...

Java equivalent to WPF's 3D functionalities

I've recently engaged on studying WPF (to be honest, I've gotten into it just because there was built-in 3D object, camera and rendering capabilities), which has allowed me to do this: Download: Master Maze Use directional keys ([ ↑ ] [ ↓ ] [→] [←]) to walk and turn, [Q] or [A], and [W] or [S] ("god mode") to have a broader look ...

How do you launch a WPF front end as a DLL from another assembly?

How does one create a WPF front-end that has an Application object from within another application (an existing MFC / CLR application, but that's another story)? The existence of the Application as the entry point of the assembly seems to prevent such a use. Certainly, you can use a WPF application as an assembly. Can't you? ...

WPF ListBox with ItemTemplate problem

I have a listbox and I am trying to Bind DataTable with it. I debug the Code and there is data in the DataTable but it does not show the data inside the DataList. <Window.Resources> <local:myCurrencyColor x:Key="CurrColor"></local:myCurrencyColor> </Window.Resources> <Grid Name="grid1"> <ListBox Margin="28,111,130,24" N...

WPF Dispatcher.PushFrame vs WinForms Application.DoEvents?

In WinForms, Application.DoEvents method has been regarded as evil by some people. Can anybody tell if its counterpart of Dispatcher.PushFrame in WPF is safe to use? ...

Error "Specified element is already the logical child of another element"?

I have a TabControl and each Tab can contain the same UI but with different data. In any tab the user can click on a button and bring up a popup. This sets a Style property to the ViewModel telling it what style to use for the popup UI. The Style gets bound to a custom DependecyProperty that is attached to a custom PopupUserControl. My p...

The property does not exist in XML namespace

I'm currently working on enabling drag-and-drop support for our company app. The error I keep getting seems weird to me. What this says is that The property 'DragDropHelper.IsDragSource' does not exist in XML namespace 'clr-namespace:DragAndDrop;assembly=DragAndDrop'. Line 61 Position 83 The property is an attached property in the ...

WPF last row listview

Hi, all!! I have a list view and bind its items to the my database by means of datacontext. <ListView x:Name="waypointList" ItemsSource="{Binding }" BorderThickness="0" ItemContainerStyle="{DynamicResource ListItemStyle}" > <ListView.View> <GridView AllowsColumnReorder="F...

Get width of combo items

Hello guys. I've got combobox binded to string[]. I haven't got clear combobox items. But I want measure my dropown items. How can I get width of items in combobox at runtime. I need this to manage width of my combo. ...

Any way to make a Separator within a WPF menu more narrow?

I've noticed that the margin or height of the default Separator as it is styled in the menus in WPF seems to be slightly larger than some other applications such as Visual Studio 2010. I know that these Separators can be re-templated by applying a new style with a custom ControlTemplate but like always I'm looking for any possible way to...

WPF FlowDocument image text wrapping

We have extended the rich text editor to provide us with additional behaviour. We have a requirement to paste images into the rich text editor and then allow the user to change the text wrapping, so that multiple lines of text wrap around the image. Images are able to be pasted into the rich text editor and the binary is embeded with...