How to get a group of toggle buttons to act like radio buttons in WPF?
This is easiest way in my opinion. <RadioButton Style=”{StaticResource {x:Type ToggleButton}}” /> Enjoy! — Pricksaw
This is easiest way in my opinion. <RadioButton Style=”{StaticResource {x:Type ToggleButton}}” /> Enjoy! — Pricksaw
<DockPanel> <Menu DockPanel.Dock=”Top”> <MenuItem Header=”_File”> <MenuItem Header=”_Open”/> <MenuItem Header=”_Close”/> <MenuItem Header=”_Save”/> </MenuItem> </Menu> <StackPanel></StackPanel> </DockPanel>
If you want to set this for just one tooltip, set the duration on the object having the Tooltip, like this: <Label ToolTipService.ShowDuration=”12000″ Name=”lblShowTooltip” Content=”Shows tooltip”> <Label.ToolTip> <ToolTip> <TextBlock>Hello world!</TextBlock> </ToolTip> </Label.ToolTip> </Label> I’d say that this design was chosen because it allows same tooltip with different timeouts on different controls. If you want this … Read more
If you use Width=”*” the column will fill to expand the available space. If you want all columns to divide the grid equally apply this to all columns. If you just want one to fill the remaining space just apply it to that column with the rest being “Auto” or a specific width. You can … Read more
I used this method by Gareth Evans in my Silverlight project. Here’s my implementation of it: public class ValueConverterGroup : List<IValueConverter>, IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return this.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); } public object ConvertBack(object value, Type targetType, object parameter, … Read more
The above solution left blue border around each cell in my case. This is the solution that worked for me. It is very simple, just add this to your DataGrid. You can change it from a SolidColorBrush to any other brush such as linear gradient. <DataGrid.Resources> <SolidColorBrush x:Key=”{x:Static SystemColors.HighlightBrushKey}” Color=”#FF0000″/> </DataGrid.Resources>
This should do exactly what the author wanted: <StackPanel Orientation=”Horizontal”> <Separator Style=”{StaticResource {x:Static ToolBar.SeparatorStyleKey}}” /> </StackPanel> if you want a horizontal separator, change the Orientation of the StackPanel to Vertical.
After using samples from this question I’ve made complete version of pan & zoom app with proper zooming relative to mouse pointer. All pan & zoom code has been moved to separate class called ZoomBorder. ZoomBorder.cs using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; namespace PanAndZoom { public class ZoomBorder : Border { … Read more
Let me answer to your question in three parts. I’m wondering what is “cs.txtCompanyID” in your example? Is it a TextBox control? If yes, then you are on a wrong way. Generally speaking it’s not a good idea to have any reference to UI in your ViewModel. You can ask “Why?” but this is another … Read more
Assuming AdvancedFormat is a bool, you need to declare and use a BooleanToVisibilityConverter: <!– In your resources section of the XAML –> <BooleanToVisibilityConverter x:Key=”BoolToVis” /> <!– In your Button declaration –> <Button Height=”50″ Width=”50″ Style=”{StaticResource MyButtonStyle}” Command=”{Binding SmallDisp}” CommandParameter=”{Binding}” Cursor=”Hand” Visibility=”{Binding Path=AdvancedFormat, Converter={StaticResource BoolToVis}}”/> Note the added Converter={StaticResource BoolToVis}. This is a very common pattern … Read more