Hi,
When will the CanExecute event be ideally raised by the control that realizes the ICommandSource interface?? I tried to add a breakpoint to the handler to check when it is getting raised and it seems to be executed whenever the control is rendered on the screen. Can someone explain when exactly it will be raised and how to raise ...
Maybe I'm going about this the wrong way but in my view model I have a list of objects (CGCAppSwitchboardItem) that each contain a DelegateCommand property. My intention here is that each item (CGCAppSwitchboardItem) in my list would represent a module inside my solution whereby a call to the command will load a module. Or, better said, ...
I intended to disable and enable the Buttons outside the TabControl, just like those inside the TabItem when the current tab is changed. But the CommandBindings of the TabItem do not seem to impact "up" the visual tree. What is the right way to do this?
With this XAML:
<Window x:Class="WpfApplication10.MainWindow"
xmlns="http://sch...
I have a WPF app that simply contains a Button and a Textbox to display some output. When the user clicks the Button, a thread starts which disables the Button, prints stuff to the output Textbox, then the thread stops (at which point I want the Button to be enabled again).
The application appears to disable the Button properly, as wel...
Is it possible to fire a command to notify the window is loaded.
Also, I'm not using any MVVM frameworks (Frameworks in the sense, Caliburn, Onxy, MVVM Toolkit etc.,)
...
I am trying to add a Ribbon Button directly to the Quick Access Toolbar by using the CanAddToQuickAccessToolBarDirectly property. I have read in order to do this a command must be enabled on the button from this source (http://blogs.msdn.com/b/llobo/archive/2010/08/06/wpf-ribbon-basics.aspx#comments). When I add a command to the button i...
Well, in our application this usually works fine. But at some point, none of the CanExecute methods fire (even if I explicitly call CommandManager.InvalidateRequerySuggested(), the CanExecute methods don't run). Anyway, despite the fact that they don't run, they all get set to false, so every button, menu item, etc, bound to a CommandBin...
The Button in WPF MainWindow has normal command attribute. When clicked the handler method receives sender. But the sender is always MainWidow. How to get sender to be a Button ? I need it to be a particular button, because I set this command to several buttons and want to use single handler for many senders. Thank you
...
I have a button on a view that is bound via a RoutedUICommand to a command defined in the ViewModel.
The XAML code excerpt from the view:
<Button Content="Login" Command="{Binding Login}" />
In the View's CodeBehind I add the command binding from the ViewModel to the view's binding collection:
this.CommandBindings.Add( viewModel.Lo...
My code is here>>
public class Player:INotifyPropertyChanging
{
string addressBar;
public string Url
{
get {
return addressBar;
}
set { addressBar = value; OnPropertyChanged("Url"); }
}
public Regex regVillage = new Regex(@"\?doc=\d+&sys=[a-zA-Z...
I know how to use the MouseDoubleClick event with my DataGrid to grab the selectedvalue, but how would one go about using command bindings instead? That way my ViewModel can handle the logic.
So far I have the following:
<DataGrid Name="TestGrid" Grid.Row="2" Grid.ColumnSpan="2" AutoGenerateColumns="True" MouseDoubleClick="TestGrid_Mou...
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...
This is weird. I have a UserControl (MyControl) with a button inside. I have added a command to this button whose command target is another user control which is again added to the same window.
When I add the UserControl statically in xaml to the CustomControl's host space, the CommandBinding system works fine, where as the same doesn't...