wpf

Why is my WPF splash screen progress bar out of sync with the execution of the startup steps?

Hello, I've implemented a simple WPF splash screen window which informs the user about the progress of the application startup. The startup steps are defined this way: var bootSequence = new[] { new {Do = (Action) InitLogging, Message = "Init logging..."}, new {Do = (Action) InitNHibernate, Message = "Init NHiberna...

How to use *.lib file in C# application?

So I have some .lib file (generated like this one) How to use it from my C# WPF application? ...

WPF: isolated storage file path too long

Hi, I'm deploying my WPF app with ClickOnce. When developing locally in Visual Studio, I store files in the isolated storage by calling IsolatedStorageFile.GetUserStoreForDomain(). This works just fine and the generated path is C:\Users\Frederik\AppData\Local\IsolatedStorage\phqduaro.crw\hux3pljr.cnx\StrongName.kkulk3wafjkvclxpwvxm...

WPF windows locked when calling webservice. Even when run asynchronously

Hi there. I'm having a big problem when calling a web service from my WPF application. The application/window locks until the process has completed. I've attempted to run this asynchronously but the problem still persists. Currently, the web service call I'm making can last 45-60 seconds. It runs a process on the server to fetch a big ...

how to pass data when using MenuItem.ItemContainerStyle

Hello Experts! i've been trying to have a dynamic ContextMenu to show the name property of each of the object in its collection of objects. here is concrete example ,i'm connecting to a webservice to pull contacts and groups of a particular account.so i have those as global variables.i display the contacts in a listbox and i want to sho...

WPF MVVM - Correct way to consume a web service asynchronously

I have implemented MVVM in my WPF application. I was wondering what is the correct way to consume a Web Service from WPF MVVM app. So far, I have created a DataAccess interface and a class that implements this interface. This would serve as a facade / proxy to the web service. The ViewModel gets a reference to this class as the constru...

WPF PasswordBox Input Panel Icon Not Appearing: Better Workaround?

Hello, There is a known issue in WPF where the Input Panel icon does not appear when you set focus on a PasswordBox control. I'm in need of a workaround for this, but the one suggested -- using the ITextInputPanel API -- does not quite cut it for me. Fist of all, the API works with Windows Forms controls and alternatively accepts cont...

How do you access a previously shaded texture in a Pixel Shader?

In WPF, I want to use a pixel shader to modify a composite image i.e. a new image overlaid on top of a previously shaded image. The new image comes in as a largely transparent image except where there is data (think mathematical functions - sine wave, etc). Anyway this process needs to repeat pretty rapidly - compose the currently shad...

MouseEvent on a Rowdefiniftion within a WPF Grid

Hi I am trying to determine which row (RowDefinition) my mouse is over within a WPF grid. I have tried adding the MouseEnter event to the RowDefinition but the event doesn't fire, the Event does fire on the Grid itself but that doesn't help as I need the name of the row the mouse is currently over. Thanks in advance. ...

Pass view to viewmodel with datatemplate

I have a window named ParameterEditorView with a ParameterEditorViewModel as DataContext. In the ParameterEditorViewModel I have a list of ParameterViewModel. In the ParameterEditorView I have an ItemsControl whose ItemsSource is binded to the list of ParameterViewModel in the ParameterEditorViewModel. I need the ParameterViewModel to ha...

Weird shape resizing behavior in WPF

Hello, I am making a WPF application that will let the user draw and resize shapes. The resizing part is done using adorners, and the shapes are my own classes derived from Shape. For example I have a Polyline, and for each of it's points I am adorning a Thumb with a handler on it's DragDelta event: void Thumb_DragDelta(objec...

RenderTargetBitmap + Resource'd VisualBrush = incomplete image

I've found a new twist on the "Visual to RenderTargetBitmap" question! I'm rendering previews of WPF stuff for a designer. That means I need to take a WPF visual and render it to a bitmap without that visual ever being displayed. Got a nice little method to do it like to see it here it goes private static BitmapSource CreateBitmapSou...

Change Button.Content through style programmatically

I would like to programmatically change content of button via style change. I created a style, added setter for Button.ContentProperty, set new style to button, but content was not changed. I know that I can set button content directly, but now I would like to know why this does not work: Style aStyle = new Style(); Setter bSetter ...

MVVM: how to set the datacontext of a user control

Hi, I'm writing an application in WPF, using the MVVm toolkit and have problems with hooking up the viewmodel and view. The model is created with ado.net entity framework. The viewmodel: public class CustomerViewModel { private Models.Customer customer; //constructor private ObservableCollection<Models.Cust...

how to use multiple tab controls, and to be able to call a selected tab control with buttons.

Please I am trying to assign each button on the left its own Tab control. That is for example, when the Intake form button is pushed, it will have its own set of tabs (its own tabcontrols) am i supposed to place multiple tab controls on the artboard, or is there a way to programatically change the names of the tabs, and there contents, ...

How do I highlight available days in a Calendar control in WPF?

Hello, I wanted to highlight some range of days in a Calendar in WPF, and make any other day in the calendar unavailable. So the user could select only the highlighted range. The problem is, I havent found anything useful to do so yet. The control itself doesnt support data binding at all (although it has Data Context property :-)), whic...

strange Problem with WPF Textbox stringformat - Cursor moves back

I am using WPF 4.0 TextBox and binding. I am using StringFormat to format the number as currency. the XAML looks like this: <TextBox Text="{Binding Path=ValueProperty, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat={}{0:C}, UpdateSourceTrigger=PropertyChanged}"> </TextBox> Everything seems to work correctly excep...

Visual Studio 2008 ContextSwitchDeadlock with log4net and NHibernate

Hello everyone, I'm facing an extremely weird bug here and I'm not really sure If I'm following the right path to solving it or even how to solve it. Here is the problem I'm facing: I start debugging a WPF application which uses log4net, NHibernate and LINQ to NHibernate, and when I try to get an Entity from the database my application...

How do I change the CellErrorStyle for an Xceed Datagrid?

So in the Xceed documentation there is a code example that does not work for me. It may be because my grid is bound to a DataGridCollectionView. The objects in the collection used by the datagridcollection are what implement IDataErrorInfo. The errors are showing up just fine. The problem is that they are using the default orange bac...

WPF - Set RelativeSource CommandTarget in RoutedCommand.Execute in code behind

I have a static class called commands. One the RoutedCommands in it is called ConfirmNoPrint. I want to Execute it in code behind from my custom control like this: Commands.ConfirmNoPrint.Execute(null, [WHAT_DO_I_PUT_HERE]); In the custom control class I have an instance of Binding whose RelativeSource property is set like this: _mai...