wpf

How to show and hide the Popup?

void Start() { System.Windows.Controls.Primitives.Popup p = new System.Windows.Controls.Primitives.Popup(); p.HorizontalOffset = this.ActualWidth / 2; p.Width = 100; p.Height = 100; p.VerticalOffset = this.ActualHeight / 2; DockPanel dock = new DockPanel(); dock.Children.Add(new Button() { Content = "Обновлено...

WPF Cloned/Detached object edit problem - what is the standard ?

Hello, I am using an ObservableCollection to wrap some of my generated entity framework objects. When the user wants to edit some values , i am opening a popup windows that contains fields, and when the user changes and press save - the changes are saved to the database, and the binded controls are changes as it is an observablecollect...

Retrieve Value on Mouse Click for WPF Column Series

I have a simple chart with two column series containing all months in the year. I want to filter a list view that show detailed information for the selected month. I can capture the event via MouseDown on the ColumnSeries but I'm not sure how to get to the month in the column series. <DVC:ColumnSeries Title=" Expenditures" Independent...

VS2010, F5 - Builds but doesn't run (WPF)

We just converted a WPF to VS2010. When I press F5, the solution builds but then does not run. If I do CNTL+F5 (start without debugging) the app runs just fine. Any ideas? Thanks, jeff ...

how can I get the color of the background in WPF

Hi, In my small WPF program I want to show the name of the "background color" of the client area on a mouse click in am message box .... How can I do it? System : Win7(32-bit)/VS2008 Thanks. ...

Sending WPF User Controls over WCF or similar

I am building an application in the MVVM style where the actual views (UserControls) are stored remotely and hopefully sent via a WCF service to my main application window. I am doing this in order to avoid having the user reinstall the application each time a new view is added. However, when I try to return a User Control from my WCF ...

Comparing just dates from DateTime C#

Hi, My table contains 2 fields with values, StartTime EndTime 3/6/2010 8:00:00 AM 3/6/2010 10:20:00 AM Now I have a datepicker control wherein the user can select a date, C# Logic: DateTime SelDate; if (datePicker.SelectedDate == null) SelDate = DateTime.Now; else ...

How to search parents ?

I have construction: Grid a = ((((usercontrol.Parent as DockPanel).Parent as ScrollViewer).Parent as Grid) Is it possible to find a tree or a parent element? example: Grid a = GetFirstParent(usercontrol,"Grid") Grid - is Type element ...

wpf app crashes when BackgroundWorker is used

hello, my view model creates a BackgroundWorker in its constructor. BackgroundWorker updates the model's properties from its DoWork event handler. The code below is a contrived example (ViewModelBase is taken almost verbatim from the MVVM paper). public class MyViewModel : ViewModelBase { public int MyProperty { get ...

Is wpf still relevant and can I use it in my C# windows application

I have a process which I break into multiple processes and even when using threading it takes a very long time to complete. I'd like to give the user an indication of the status of the execution in a cute way. (for each process % complete) Maybe betting the right horse will ease the pain :) I found this project long ago: http://www.co...

Filter a collection with LINQ vs CollectionView

Hello, I want to filter a ObservableCollection with max 3000 items in a DataGrid with 6 columns. The user should be able to filter in an "&&"-way all 6 columns. Should I use LINQ or a CollectionView for it? LINQ seemed faster trying some www samples. Do you have any pro/cons? UPDATE: private ObservableCollection<Material> _materialLi...

AXdsoframer control Not firing OnSaveCompleted event for Excel spreadsheets

Hi, I am using the AXDSoFramer to host excel, word documents in my wpf application. I have the OnSaveCompleted event hookedup but the problem is it DOES not get fired for excel spreadsheets(all versions) but it does work for Word documents tho. Is there something that I am missing? Thanks! Matt ...

why i couldn't see any data in WPF Grid?

<DataTemplate x:Key="tmpGrdProducts"> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> ...

WPF TextBox Validation Style Disappears when Mouse is over, or it has focus.

I am creating a custom text box control to have some default formatting and validation functionality, including a custom validation property which accepts an Action or custom function. In my current situation I can't use the Attribute validation framework that some people have posted, since I don't quite have access to modify the data m...

How to update iFrame source from twolistboxes on selected item value???

I have a two listboxes where I generate content from XML. I define UriSource in XML. I'd like to find out how I can update Frame's Source property from two different lisboxes. Any ideas are highly appreciated. XAML: Listboxes and Frame: <Grid x:Name="PANEL_BottomArea_Grid" DataContext="{Binding Source={StaticResource PagesData}}"> ...

WPF Sentinel objects and how to check for an internal type

Hi folks, As some of you have discovered, a new feature (?) appeared WPF 4, where the data binding engine may pass your custom control instances of the class MS.Internal.NamedObject with the name "{DisconnectedItem}" into the DataContext - instead of the data item your code is expecting (this happens when a templated control is disconne...

Winform->WPF MVVM Keybinding Error?

I need some assistance in getting WPF KeyBindings working when being called from a WinForm application. I've created what I think is the basic parts to demonstrate the problem. I can provide an sample application if that helps. The WinForm application starts a form which has a button that calls the WPF Private Sub Button1_Click(ByVal ...

How to add a DataTemplate to a ToolTip for a wpf ComboBox using a Style

I am trying to format a ToolTip in a ComboBox. The following XAML is correctly picking up the value needed for the ToolTip, but not the DataTemplate. <DataTemplate DataType = "ToolTip"> <TextBlock Width = "200" TextWrapping = "Wrap" Text = "{Binding}" /> </DataTemplate> <Style x:Key = "RadComboBoxStyle1" Targ...

Getting button x y params

What would be the best way to get button parameters when my button is in an array class myButtonproprties { int x; int y; } where i use it as: myButtonproprties array[][]; I am new to WPF and I have heard about the dependency property mechanism and didn't understand it would it be helpful here? EDIT: let's say i am alre...

How do I trigger a WPF expander IsExpanded property from another expander's IsExpanded property

I have two expanders, side by side. I want only one to be expanded at a time. So if one is expanded, and the user expands the other, I want the first one to collapse. The user can have both collapsed, and both collapsed is the starting state. As can be seen in the code, I have included the "Header" property as a test, and it works as...