wpf

MVVM Tabs: Focus new tab

I can add & remove tabs similar to the famous MSDN article. Basically a ObservableCollection<TabViewModels>. And I add tabs like _tabs.Add(new TabViewModel()) but the newest tab is not focused. I want to focus it. How do I do it? 1 way to do it since i have a view source for my observable collection, I can do the below... another optio...

Dependency Property Not Updating?

I don't know if I am using dependency properties right, but it seems my View never updates. I have a style trigger to change the styles of my elements. It seems the code runs, but the view is not updated. This is my 1st time using a Dependency Property & I maybe using it wrong C# public bool CanSave { get { return (bool)GetValue(C...

Canvas scroll in wpf when scaled transformed

Hi, I have customized a canvas to support the zooming. I am doing this by scale transformation. I have scroll viewer wrapped around canvas but scroll bars are not visible when canvas is zoomed. I came to know that scale transformation does not changes the actual size of the UIElement that is why scroll bars are not visible when canvas ...

Do not add a event click

When you add a Click event throws System.NullReferenceException. <ListBox DockPanel.Dock="Top" DataContext="{Binding idPerson, Converter={StaticResource ConvertTrainersFromClientsKey}}" ItemsSource="{Binding}" > <ListBox.ItemTemplate> <DataTemplate> <DockPanel> <Button Content="{Binding name_trainer}" Tag="{Binding idPersonTra...

In WPF pop up messages, drop down list appear behind main window.

I am currently working on WPF touch-screen application. I am developing it on Windows XP machine. I have tested it on this machine and it works perfectly fine. But when I deploy it to Windows Embedded machine I start to get strange behaviour: all pop up messages, drop down list, context menus appear behind the main window. I am also set...

How to change image\parameters on style definition ?

I define some new button style. The style default background is image X.bmp and when on 'mouseOver' is true the image is changing to Y.bmp I have 10 buttons on the code that need to use this style - and each of the button need to show different image as default different image on 'mouseOver' event. I can set the bitmap on each butto...

How to force a RibbonButton to be alway enabled ?

I have a Microsoft Ribbonbar inside a Window, and every RibbonButton is associated to a specific command like this: <ribbon:Ribbon x:Key="MyToolbar" Name="MyToolbar" > <ribbon:RibbonTab Header="File" > <ribbon:RibbonGroup Header="File" > <ribbon:RibbonButton Command="{x:Static ApplicationCommands.New}" LargeImageSource="Ima...

Is Mole for Visual Studio by Karl Shifflett still active?

I've been reading about Mole and am interested in trying it but it doesn't look like it's being kept up to date as there's no mention in the documentation of Windows 7 or Visual Studio 2010. Is the project still active or is it now obsolete because there's a better alternative? Has anyone managed to get it working with Windows 7 and Visu...

How to make BlockingCollection observable?

I've written a nice priority queue class, class ConcurrentPriorityQueue<T> : IProducerConsumerCollection<KeyValuePair<int,T>>, INotifyCollectionChanged where T : INotifyPropertyChanged which I now want to wrap in a in a BlockingCollection, Queue = new ConcurrentPriorityQueue<DownloadItem>(10); Buffer = new BlockingCollectio...

C# & WPF : How to update an in-code declared textbox height on textbox content change?

Hello everyone, I'm fairly new to C#, I'm on a C# & Wpf course. Here my teacher has told us to inherit from UserControls and create a wpf control library of our own. In order for us to create a simple UML Editor, and right now I'm working on a Class Control. The visual representation of a class as seen here: http://www.softwarefactorie...

How to read the checkbox value in RowHeaderTemplate?

<my:DataGrid.RowHeaderTemplate> <DataTemplate> <Grid> <CheckBox Name="dgChkSelect" Checked="dgChkSelect_Checked" Unchecked="dgChkSelect_Unchecked" Tag="{Binding}" /> <!--IsChecked="{Binding Path=IsSelected,Mode=TwoWay,Rel...

open a PDF : WPF

I want to open a PDF file in a button click. I'll keep the PDF file within the solution/namespace of the project. Can anyone give me solution for this? ...

Wpf - NavigationService.GoBack() and Listbox SelectionChanged Event

Hi All, In ADDPage.xaml page there i s a Back Button with the code NavigationService.GoBack() to go back to the previous page. Problem: In the Listbox SelectionChanged Event of another page (SubPage.xaml)i am using the NavigationService.Navigate(new ADDPage(search)); When ever the page executes NavigationService.GoBack() of ADDPage...

wpf visibility problem

Default Visibility enum contains Collapsed Hidden Visible I need another one name NotCreatable. When set Visibility to Notcreatable, current Element must not created on view level. Because I have 2 class inherits from A public Class B:A { Property B1;} public Class C:A { Property C1;} my xaml <stackpanel DataContext="{Binding ob...

Using a View as a Data Template

Hi, I am using the MVVM structure for our application. I have added the view as a data template to a grid (Developer Express DXGrid). <DataTemplate x:Key="cardTemplate"> <ui:MediaEnquiryParticipantView x:Name="mediaEnquiryParticipantView"/> </DataTemplate> Now, my problem is that i want that View(MediaEnquiryParticipantView) to ...

WPF Clickable button under label

Hello. I have button. I have expander in button and label above expander in the same button. I can click on button with no problem, but there is problem where I click on label (Nothing happens). How can I make this: When user clicks on label in button, button is being clicked. I want to transfer click event from label to button that cont...

C# WPF DragMove without Window_LocationChanged()

I implemented something in Windows Forms similar to DragMove but with boundaries set to 10 units of the margins of the primary screen. When switching over to WPF I found this thread to be useful in achieving the same result. However, since this is a post-move event, what happens is that if my window is dragged beyond the boundaries I s...

GridSplitter with min constraints

I whant a Grid layout with two rows and splitter between them. Rows should has a minimum height of 80 pixels. Next code works great: <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" MinHeight="80" /> <RowDefinition Height="5" /> <RowDefinition Height="*" MinHeight="80" /> </Grid.RowDefinitions> ...

XNA 4.0 free e-books

Does anybody know some XNA 4.0 papers. I'm interested in e-books and other documents/papers. Preferably free.... Non-common websites are also welcome :) (Not returned from google search) ...

Visual Studio 2010 WPF Designer scale

Hello. I made simple interface in Visual Studio 2010. When I launched application everything is bigger. Red square on screenshot represents size of the Button in launched application (On the right). Am I missing something? How to fix it? P.S. In "Microsoft Expression Blend 4" the same project is exactly the same size as in editor. ...