I've got a view which shows a listbox that is bound to GetAll():
<DockPanel>
<ListBox ItemsSource="{Binding GetAll}"
ItemTemplate="{StaticResource allCustomersDataTemplate}"
Style="{StaticResource allCustomersListBox}">
</ListBox>
</DockPanel>
GetAll() is an ObservableCollection property in my ViewMod...
I'm using a WrapPanel as the ItemsPanel of an ItemsControl. Right now, the items in the control wrap like this:
|1234567 |
|890 |
I'd like them to wrap like this:
| 1234567 |
| 890 |
Conceptually, the layout process should align each line of items such that it's centered within the WrapPanel's bounds.
Can someone explai...
I have the following XAML for a databound items control to show a list of groups, with a label and button to add a new group appearing first:
<WrapPanel Orientation="Horizontal">
<Label Content="Groups" />
<Button x:Name="btnGroupAdd" Click="btnGroupAdd_Click" Content="+" />
<ItemsControl ItemsSource="{Binding}" x:Name="_groupList" >...
What would be a good approach to display and edit large amount of unformatted text (just like notepade does) using WPF? Loading a big string into a TextBox makes the UI unresponsive. The overall performance is not nearly comparable with TextBox Controls of previous Microsoft UI Frameworks.
What options do I have to solve this problem. ...
I have a WPF application that has a 3rd party data grid with a border around it. I've used the DropShadowEffect to put a shadow behind the border, but this seems to affect performance somewhat (not nearly as much as a BitmapEffect, but still noticeable) and makes the font rendering fuzzy. Is there a way to somehow apply the effect to t...
How might I create a brush that paints a regular, repeated grid of 1-unit thick lines spaced evenly in both the horizontal and vertical axes? Imagine graph paper, if you will.
Ideally the solution would allow control over the brushes used for the lines and the background (the regions within the squares). In this way the background cou...
I have a converter that takes a string as input and returns an icon. It's used to provide a icon that is used in a list box. When the itemsSource is set to a list whose items have a property that returns a string, the XAML looks as follows:
<Image Source="{Binding FileName, Converter={StaticResource FileNameToIconConverter}}"/>
That i...
I am just coming up to speed on WPF and would like to create a reusable WPF control.
When I look at the options for creating projects in Visual Studio, I see "WPF User Control Library" and "WPF Custom Control Library". It's unclear to me what the difference is between them and my Google searches have not turned up any decent explanat...
Is there a way to launch a C# application with the following features?
It determines by command-line parameters whether it is a windowed or console app
It doesn't show a console when it is asked to be windowed and doesn't show a GUI window when it is running from the console.
For example, myapp.exe /help would output to stdout on the...
Does anyone know how to determine if the value of a WPF property is inherited? In particular, I'm trying to determine if the DataContext of a FrameworkElement was inherited from the parent or set directly on the element itself.
Thanks,
- Mike
...
Is there any way to turn to WPF app into an ASP app? Or are they totally unrelated technologies? XAML format reminds me so much of HTML that it seems like there might be a way. Thanks.
...
I have a WPF application with a form that, when started, invokes a custom method in a new thread.
Private Sub TestStep1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim oThread As New Thread(AddressOf DisplayNextPicture)
oThread.Start()
End Sub
Private Sub DisplayNextPicture()
...
Can anyone tell me how to programmatically navigate through all UI element tab stops in a WPF application? I want to start with the first tab stop sniff the corresponding element, visit the next tab stop, sniff the corresponding element, and so on until I reach the last tab stop.
Thanks,
- Mike
...
I've built a WPF application. All of the UI elements except the Window are created in response to data binding. Thus, I set the DataContext of the Window, and voila -- a very large hierarchy of UI elements materializes on the screen. The UI contains lists of panels with lists, labels, more panels, textboxes, checkboxes, you name it. ...
Thanks to an answer on a previous question (Previous Question), I now have a body of code that navigates WPF tab stops (shown below). It works fine except for the first tab stop. Calling this.MoveFocus(...First) and followed by FocusManager.GetFocusedElement returns null. Any ideas? How do I get the first tab stop in my window?
Than...
I'm trying to use WindowsFormsHost in a WPF app so I can use some Windows Forms components.
<Grid>
<WindowsFormsHost>
</WindowsFormsHost>
</Grid>
This all works ok with no errors, but when I go to drag a Windows Forms component from the toolbox in VS2008, they're all grayed out. In a way this makes sense as only the WPF compo...
Is there an event that is fired when the user presses the close button?
This is because the Window Closing event is fired both when one closes the window manually (with the Close method) and also when the user presses the [X] button...but I somehow need to know only when the user presses the [X] button not when the window is closed manu...
I have a TextBox bound to a ViewModel's Text property with the following setup:
Xaml
<TextBox Text="{Binding Text}"/>
C#
public class ViewModel : INotifyPropertyChanged
{
public string Text
{
get
{
return m_Text;
}
set
{
if (String.Equals(m_Text, value))
...
I would like to pass a parameter defined in the XAML (View) of my application to the ViewModel class by using the RelayCommand. I followed Josh Smith's excellent article on MVVM and have implemented the following.
XAML Code
<Button
Command="{Binding Path=ACommandWithAParameter}"
CommandParameter="Orange"
...
Hi,
I am calling Application.Current.Shutdown method from class that is binded to xaml windows with objectdataprovider, but the application is not closing, can anyone help me to understand why? And i note that my application is not closing completely after my main window is closed, it doesn't disappear from task manager's process list....