wpf

Windows 7 Aero theme

Hi, I've already check stackoverflow and the web for my problem, but I can't find any answer. I can't find a way to have the Windows 7 Aero theme working. I mean, I have the Aero style from PresentationFramework.Aero, but it has the Vista look, the blue selection is not exactly the same. This is the Windows 7 theme in Windows Explorer...

Lazy loading System.Windows.Control.Image only when visible

I need my application to render an image only when it becomes visible to the user. I tried attaching. I've tried the following (f#): image.IsVisibleChanged.Add(fun e -> if image.IsVisible & mtvCapture.Capture <> null then mtvCapture.BeginCapture() ) But this just loads, doesn't lazy load. How does IsV...

aliasing problem

hello, the code below draws two vertical lines on a canvas. these lines appear to be of different thickness on the screen although they are the same in code. i am tying to find a way to make them look as sharp as the border around the canvas. setting Path.SnapsToDevicePixels does not have any effect. The code is a contrived example, and...

Binding XML file to a UserControl

I want to bind the data from my XML file to my userControl. So far I have: XML file: <?xml version="1.0" encoding="utf-8"?> <testData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <pumps> <pump> <speed value="1200"/> <color value="Black"/> ...

Strange: WPF DataGrid doesn't allow new items

Everything works fine, even adding new items, but if there are no previous items (i.e. the new editing row is the first row in the collection) then the the new row is deleted right after its creation (when creating a new row after passing the The DataGrid.InitializingNewItem event handler, the ObservableCollection.CollectionChanged is tr...

Entity Framework Attach Exception After Clone

After trying several options of having a decent mechanism which allows to use ObservableCollections with the option to dynmically having them updated using an Edit window and binding, without having the global collections updated while making changes on the bound controls, so far the best solution seems to be : Clone the entity, detach t...

FindForm and WPF

I have an application that has a WinForm(myForm). In that WinForm there are a WPF UserControl(myWPF). In that WPF UserControl there are a WinForm UserControl(myWinCtrl). The myWinCtrl has a custom WinGrid(myWinGrid). myWinGrid does internally a this.FindForm() and.... does not find myForm... Is there a way to override the FindForm ...

Using ATL ActiveX control inside WPF Window application

The COM object was not created. The following is XAML code: Title="Window1" Height="373" Width="701" Loaded="Window_Loaded"> Draw Contour <Window.Resources> <!--<BitmapImage x:Key="MyImageSource" UriSource="c:/cs3/TextAc...

How can I get notified that binding has finished?

I have an application to which I want to add a progress bar. It works in most cases. In one case the time is actually taken because of binding and layout work which is asynchronous, so my progress bar is hidden before the work is actually done. Its rather large list of items shown within a scroll view. I can't use virtualizing becaus...

Help with C# logic

Hi, Please see my code below, I want to add data in the roomBlock collection such that for every unique names in Hotelnm, it contains all the records for that particular hotel name. So if my UI first displays hotel name as ABC then the corresponding roomBlock will have all the records from result.ResultSet that has that name in it. How...

How can one link a DataTrigger to whether a ScrollViewer can scroll up?

I am wanting to show a half opaque arrow at the top and bottom of my ScrollViewer if it can scroll up or down respectively. I'm thinking the best option is a DataTrigger, but I'm not sure what I can tie it too. I'm trying to avoid subclassing ScrollViewer, but if I absolutely have to, I will. Any ideas? I'm using the .Net Framework 3...

PRISM: Creating Pipeline of Async methods

I am wondering if anyone can help me with something here: I am trying to create a "pipeline" or "queue" of commands [similar to CompositeCommand in Prism] except I want it to be sequential even if the command being executed is Asynchronous in nature. Basically, I want to string together bunch of Async calls [not at compile time but at r...

WPF control with many GridViews

I have a WPF usercontrol that will dynamically have any number of gridviews. Each is essentially the exact same except for the ItemsSource. Therefore each have the same columns and the same RowDetailsTemplate. To be specific what I am actually doing is settings the columns to the bound values and then setting the RowDetailsTemplate to th...

Problem deploying WPF application

I created an installer for it, installed .NET Framework 4 on target machine. However, my application didn't work. I've got a message, that is has stopped working and offered to send a report. Windows log: The name of the offending module: KERNELBASE.dll, version: 6.1.7600.16385 Exception Code: 0xe0434352 Offset error: 0x00009617 ...

How can I restrict the size of a popup to the screen

I am using a Popup in the control template of a MenuItem. However, I don't know in advance how many items will be in the menu item. As a result, the popup might not fit on the screen and some items might not be accessible. My solution is to set MaxSize to, say, 500, and wrap the ItemsPresenter in a ScrollViewer. However, this does not...

WPF Generic Search Box for a window (only View search no backend search)

I was thinking of ways to implement a generic View search. What I mean here is say a Window has many controls (including usercontrols,customcontrols, etc). I want to implement a generic search box on the top of window which searches any Text in the window and highlight them. I wanted to know is there a generic way of doing this or has ...

How do you keep an indeterminate progress bar from freezing?

What good is an indeterminate progress bar that is frozen because of course its on the same thread? Is there a way to keep it running? Possibly multi-threading? ...

Update WPF ListBoxItem without ListBox.Items.Refresh()?

I have a DataTemplate that I use to display details from a class in a ListBox. The DataTemplate has an EventTrigger attached to the (item) Loaded event that uses a DoubleAnimation to fade each item into view as they are added to the ObservableCollection that is bound to the ListBox. It also has a DataTrigger that uses a DoubleAnimation ...

For a user control with a listbox, how can I expose the selected item to a parent page?

I have a simple user control which wraps some logic around an AutoCompleteBox. This question could apply to any ItemsControl control like a dropdown or listbox though. <UserControl> <Grid Background="White"> <sdk:AutoCompleteBox Name="myACB" ItemsSource="{Binding myData}" /> </Grid> </UserControl> I want expose the Sel...

Focus and Selection Styling listbox items with multiple possible templates

Good afternoon, I have a listbox that consumes a list of items from a model, Addresses and RAddresses (inherited from Addresses) Now, previously I have been creating my item templates in the ItemContainerStyle so that I have only my own focus visuals (i.e. no dotted line, no light grey rectangle, etc). This has worked fine in the past...