Here are the examples of the csharp api System.Windows.Input.ICommand.CanExecute(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
518 Examples
19
View Source File : SegmentedControl.cs
License : MIT License
Project Creator : 1iveowl
License : MIT License
Project Creator : 1iveowl
[EditorBrowsable(EditorBrowsableState.Never)]
public void RaiseSelectionChanged()
{
OnSegmentSelected?.Invoke(this, new SegmentSelectEventArgs { NewValue = this.SelectedSegment });
if (!(SegmentSelectedCommand is null) && SegmentSelectedCommand.CanExecute(SegmentSelectedCommandParameter))
{
SegmentSelectedCommand.Execute(SegmentSelectedCommandParameter);
}
}
19
View Source File : InvokeCommandAction.cs
License : MIT License
Project Creator : 1iveowl
License : MIT License
Project Creator : 1iveowl
public async Task<bool> Execute(object sender, object parameter)
{
if (Command is null)
{
return false;
}
object resolvedParameter;
if (!(CommandParameter is null))
{
resolvedParameter = CommandParameter;
}
else if (!(Converter is null))
{
resolvedParameter = Converter.Convert(parameter, typeof(object), ConverterParameter, null);
}
else
{
resolvedParameter = parameter;
}
if (!Command.CanExecute(resolvedParameter))
{
return false;
}
Command.Execute(resolvedParameter);
await Task.CompletedTask;
return true;
}
19
View Source File : DigitalAnalyzerScrollBehavior.cs
License : MIT License
Project Creator : ABTSoftware
License : MIT License
Project Creator : ABTSoftware
private void ScrollViewer_OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Shift))
{
if (ChangeChannelHeightCommand?.CanExecute(null) != true) return;
ChangeChannelHeightCommand.Execute(e.Delta > 0 ? ChannelHeightDelta : -ChannelHeightDelta);
e.Handled = true;
}
else if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control))
{
if (!(sender is ScrollViewer scroll)) return;
scroll.ScrollToVerticalOffset(scroll.VerticalOffset - e.Delta);
e.Handled = true;
}
}
19
View Source File : EventToCommandBehavior.cs
License : MIT License
Project Creator : ABTSoftware
License : MIT License
Project Creator : ABTSoftware
private void ExecuteCommand(object sender, EventArgs e)
{
object parameter = this.PreplacedArguments ? e : null;
if (this.Command != null)
{
if (this.Command.CanExecute(parameter))
this.Command.Execute(parameter);
}
}
19
View Source File : SettingItem.xaml.cs
License : MIT License
Project Creator : Accelerider
License : MIT License
Project Creator : Accelerider
private void SettingItem_OnMouseUp(object sender, MouseButtonEventArgs e)
{
if (Command?.CanExecute(CommandParameter) ?? false) Command.Execute(CommandParameter);
}
19
View Source File : SearchBar.xaml.cs
License : MIT License
Project Creator : Accelerider
License : MIT License
Project Creator : Accelerider
private void PART_SearchBox_TextChanged(object sender, TextChangedEventArgs e)
{
var text = PART_SearchBox.Text;
if (IsRealTimeMode &&
!string.IsNullOrEmpty(text) &&
SearchCommand.CanExecute(text))
{
SearchCommand.Execute(text);
}
}
19
View Source File : CommandExtensions.cs
License : MIT License
Project Creator : Accelerider
License : MIT License
Project Creator : Accelerider
public static void Invoke(this ICommand @this, object parameter = null)
{
if (@this != null && @this.CanExecute(parameter)) @this.Execute(parameter);
}
19
View Source File : EventToCommand.cs
License : GNU General Public License v3.0
Project Creator : aduskin
License : GNU General Public License v3.0
Project Creator : aduskin
protected override void Invoke(object parameter)
{
if (replacedociatedElementIsDisabled() && !AlwaysInvokeCommand)
return;
var command = GetCommand();
var parameter1 = CommandParameterValue;
if (parameter1 == null && PreplacedEventArgsToCommand)
parameter1 = EventArgsConverter == null
? parameter
: EventArgsConverter.Convert(parameter, EventArgsConverterParameter);
if (command == null || !command.CanExecute(parameter1))
return;
command.Execute(parameter1);
}
19
View Source File : EventToCommand.cs
License : GNU General Public License v3.0
Project Creator : aduskin
License : GNU General Public License v3.0
Project Creator : aduskin
private void EnableDisableElement()
{
var replacedociatedObject = GetreplacedociatedObject();
if (replacedociatedObject == null)
return;
var command = GetCommand();
if (!MustToggleIsEnabledValue || command == null)
return;
replacedociatedObject.IsEnabled = command.CanExecute(CommandParameterValue);
}
19
View Source File : InvokeCommandAction.cs
License : GNU General Public License v3.0
Project Creator : aduskin
License : GNU General Public License v3.0
Project Creator : aduskin
protected override void Invoke(object parameter)
{
if (replacedociatedObject == null)
return;
var command = ResolveCommand();
if (command == null || !command.CanExecute(CommandParameter))
return;
command.Execute(CommandParameter);
}
19
View Source File : ClickBehavior.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu
License : Mozilla Public License 2.0
Project Creator : agebullhu
private void OnCanExecuteChanged(object sender, EventArgs e)
{
replacedociatedObject.IsEnabled = Command.CanExecute(CommandProperty);
}
19
View Source File : ClickBehavior.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu
License : Mozilla Public License 2.0
Project Creator : agebullhu
private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount > 1 && !IsDoubleClick)
{
return;
}
e.Handled = true;
ICommand cmd = Command;
object par = CommandParameter;
if (cmd.CanExecute(par))
{
cmd.CanExecute(par);
}
}
19
View Source File : CommandReference.cs
License : GNU Affero General Public License v3.0
Project Creator : akshinmustafayev
License : GNU Affero General Public License v3.0
Project Creator : akshinmustafayev
public bool CanExecute(object parameter)
{
if (Command != null)
return Command.CanExecute(parameter);
return false;
}
19
View Source File : ListBoxExtensions.cs
License : GNU General Public License v3.0
Project Creator : alexdillon
License : GNU General Public License v3.0
Project Creator : alexdillon
private static void OnListBoxScrollChanged(object sender, ScrollChangedEventArgs e)
{
var scrollViewer = (ScrollViewer)sender;
var listBox = scrollViewer.TemplatedParent as ListBox;
var topSnap = GetTopLoadingSnap(listBox);
var bottomSnap = GetBottomLoadingSnap(listBox);
if (bottomSnap > 0)
{
scrollViewer.UpdateLayout();
scrollViewer.ScrollToVerticalOffset(bottomSnap);
scrollViewer.UpdateLayout();
SetBottomLoadingSnap(listBox, 0);
return;
}
else if (topSnap != 0)
{
// Calculate the offset where the last message the user was looking at is
// Scroll back to there so new messages appear on top, above screen
scrollViewer.UpdateLayout();
double newHeight = scrollViewer?.ExtentHeight ?? 0.0;
double difference = newHeight - topSnap;
scrollViewer.ScrollToVerticalOffset(difference);
SetTopLoadingSnap(listBox, 0);
return;
}
// Check to see if scrolled to top
if (scrollViewer.VerticalOffset == 0)
{
var command = GetScrollToTop(listBox);
if (command != null && command.CanExecute(null))
{
// Save the original position to allow us to return to it when the UI update is completed
double originalHeight = scrollViewer?.ExtentHeight ?? 0.0;
double originalOffset = scrollViewer?.VerticalOffset ?? 0.0;
// Run the At-Top handler
scrollViewer.CanContentScroll = false;
SetTopLoadingSnap(listBox, (int)originalHeight);
command.Execute(scrollViewer);
scrollViewer.CanContentScroll = true;
}
}
else if ((int)scrollViewer.VerticalOffset == (int)scrollViewer.ScrollableHeight)
{
if (e.VerticalChange < 1000)
{
var command = GetScrollToBottom(listBox);
if (command != null && command.CanExecute(null))
{
// Save the original position to allow us to return to it when the UI update is completed
double originalHeight = scrollViewer?.ExtentHeight ?? 0.0;
double originalOffset = scrollViewer?.VerticalOffset ?? 0.0;
// Run the At-Bottom handler
scrollViewer.CanContentScroll = false;
SetBottomLoadingSnap(listBox, (int)originalOffset);
command.Execute(scrollViewer);
scrollViewer.CanContentScroll = true;
}
}
}
}
19
View Source File : InfiniteScrollBehavior.cs
License : GNU General Public License v3.0
Project Creator : alexdillon
License : GNU General Public License v3.0
Project Creator : alexdillon
protected override void OnAttached()
{
base.OnAttached();
Observable.FromEventPattern(this.replacedociatedObject, nameof(this.replacedociatedObject.LayoutUpdated))
.Take(1)
.Subscribe(_ =>
{
var scrollViewer = this.replacedociatedObject.Scroll as ScrollViewer;
scrollViewer.GetObservable(ScrollViewer.VerticalScrollBarMaximumProperty)
.Subscribe(vscroll =>
{
this.verticalHeightMax = vscroll;
if (this.LockedToBottom)
{
// Scroll to bottom
scrollViewer.SetValue(ScrollViewer.VerticalScrollBarValueProperty, this.verticalHeightMax);
}
})
.DisposeWith(this.disposables);
scrollViewer.GetObservable(ScrollViewer.OffsetProperty)
.ForEachAsync(offset =>
{
if (scrollViewer.Extent.Height == 0)
{
this.LockedToBottom = scrollViewer.Bounds.Height == 0;
}
if (offset.Y <= double.Epsilon)
{
// At top
if (this.ReachedTopCommand.CanExecute(scrollViewer))
{
this.ReachedTopCommand.Execute(scrollViewer);
}
}
var delta = Math.Abs(this.verticalHeightMax - offset.Y);
if (delta <= double.Epsilon)
{
// At bottom
this.replacedociatedObject.SetValue(InfiniteScrollBehaviorPositionHelper.IsNotAtBottomProperty, false);
this.LockedToBottom = true;
}
else
{
// Not at bottom
this.replacedociatedObject.SetValue(InfiniteScrollBehaviorPositionHelper.IsNotAtBottomProperty, true);
this.LockedToBottom = false;
}
})
.DisposeWith(this.disposables);
});
}
19
View Source File : FlexLayoutTappedBehavior.cs
License : MIT License
Project Creator : Altevir
License : MIT License
Project Creator : Altevir
private void OnTapped(object sender, EventArgs e)
{
if (sender is BindableObject bindable && this.Command != null && this.Command.CanExecute(null))
{
this.Command.Execute(bindable.BindingContext);
}
}
19
View Source File : ContentDialog.cs
License : MIT License
Project Creator : amwx
License : MIT License
Project Creator : amwx
private void HandlePrimaryClick()
{
var ea = new ContentDialogButtonClickEventArgs(this);
OnPrimaryButtonClick(ea);
if (ea.Cancel)
return;
result = ContentDialogResult.Primary;
if (!ea.IsDeferred)
{
if (PrimaryButtonCommand != null && PrimaryButtonCommand.CanExecute(PrimaryButtonCommandParameter))
{
PrimaryButtonCommand.Execute(PrimaryButtonCommandParameter);
}
HideCore();
}
else
{
IsEnabled = false;
}
}
19
View Source File : ContentDialog.cs
License : MIT License
Project Creator : amwx
License : MIT License
Project Creator : amwx
private void HandleSecondaryClick()
{
var ea = new ContentDialogButtonClickEventArgs(this);
OnSecondaryButtonClick(ea);
if (ea.Cancel)
return;
result = ContentDialogResult.Secondary;
if (!ea.IsDeferred)
{
if (SecondaryButtonCommand != null && SecondaryButtonCommand.CanExecute(SecondaryButtonCommandParameter))
{
SecondaryButtonCommand.Execute(SecondaryButtonCommandParameter);
}
HideCore();
}
else
{
IsEnabled = false;
}
}
19
View Source File : ContentDialog.cs
License : MIT License
Project Creator : amwx
License : MIT License
Project Creator : amwx
private void HandleCloseClick()
{
var ea = new ContentDialogButtonClickEventArgs(this);
OnCloseButtonClick(ea);
if (ea.Cancel)
return;
result = ContentDialogResult.None;
if (!ea.IsDeferred)
{
if (CloseButtonCommand != null && CloseButtonCommand.CanExecute(CloseButtonCommandParameter))
{
CloseButtonCommand.Execute(CloseButtonCommandParameter);
}
HideCore();
}
else
{
IsEnabled = false;
}
}
19
View Source File : MenuFlyoutItem.cs
License : MIT License
Project Creator : amwx
License : MIT License
Project Creator : amwx
protected virtual void OnClick()
{
RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent));
if (Command?.CanExecute(CommandParameter) == true)
{
Command.Execute(CommandParameter);
}
}
19
View Source File : MenuFlyoutItem.cs
License : MIT License
Project Creator : amwx
License : MIT License
Project Creator : amwx
private void CanExecuteChanged(object sender, EventArgs e)
{
var canExec = Command == null || Command.CanExecute(CommandParameter);
if (canExec != _canExecute)
{
_canExecute = canExec;
UpdateIsEffectivelyEnabled();
}
}
19
View Source File : XamlUICommand.cs
License : MIT License
Project Creator : amwx
License : MIT License
Project Creator : amwx
public bool CanExecute(object param)
{
bool canExec = false;
var args = new CanExecuteRequestedEventArgs(param);
CanExecuteRequested?.Invoke(this, args);
canExec = args.CanExecute;
var command = Command;
if (command != null)
{
bool canExecCommand = command.CanExecute(param);
canExec = canExec && canExecCommand;
}
return canExec;
}
19
View Source File : GridViewSorting.cs
License : GNU General Public License v3.0
Project Creator : AndreiFedarets
License : GNU General Public License v3.0
Project Creator : AndreiFedarets
private static void OnColumnHeaderClick(object sender, RoutedEventArgs e)
{
GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader;
if (headerClicked != null)
{
string propertyName = GetPropertyName(headerClicked.Column);
if (!string.IsNullOrEmpty(propertyName))
{
ListView listView = GetAncestor<ListView>(headerClicked);
if (listView != null)
{
ICommand command = GetCommand(listView);
if (command != null)
{
if (command.CanExecute(propertyName))
{
command.Execute(propertyName);
}
}
else if (GetAutoSort(listView))
{
ApplySort(listView.Items, propertyName);
}
}
}
}
}
19
View Source File : ControlEventCommandBehavior.cs
License : GNU General Public License v3.0
Project Creator : AndreiFedarets
License : GNU General Public License v3.0
Project Creator : AndreiFedarets
private void UpdateEnabledStateInternal()
{
if (TargetObject == null)
{
Command = null;
CommandParameter = null;
return;
}
if (Command != null)
{
Control control = TargetObject;
control.IsEnabled = Command.CanExecute(CommandParameter);
}
}
19
View Source File : EventToCommandBehavior.cs
License : MIT License
Project Creator : AndyCW
License : MIT License
Project Creator : AndyCW
void OnEvent(object sender, object eventArgs)
{
if (Command == null)
{
return;
}
object resolvedParameter;
if (CommandParameter != null)
{
resolvedParameter = CommandParameter;
}
else if (Converter != null)
{
resolvedParameter = Converter.Convert(eventArgs, typeof(object), null, null);
}
else
{
resolvedParameter = eventArgs;
}
if (Command.CanExecute(resolvedParameter))
{
Command.Execute(resolvedParameter);
}
}
19
View Source File : Entry.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void ExecuteCompletedCommand()
{
if (this.CompletedCommand != null)
if (this.CompletedCommand.CanExecute(this.CompletedCommandParameter))
this.CompletedCommand.Execute(this.CompletedCommandParameter);
}
19
View Source File : Entry.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void CommandCanExecuteChanged(object sender, EventArgs eventArgs)
{
ICommand cmd = CompletedCommand;
if (cmd != null)
IsEnabled = cmd.CanExecute(CompletedCommandParameter);
}
19
View Source File : ListView.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
{
if (ItemTappedCommand != null && ItemTappedCommand.CanExecute(null))
ItemTappedCommand.Execute(e.Item);
}
19
View Source File : ListView.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void InfiniteListView_ItemAppearing(object sender, ItemVisibilityEventArgs e)
{
var items = ItemsSource as IList;
if (items != null && e.Item == items[items.Count - 3])
{
if (InfiniteScrollCommand != null && InfiniteScrollCommand.CanExecute(null))
InfiniteScrollCommand.Execute(null);
}
}
19
View Source File : Picker.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void OnSelectedItemPropertyChanged()
{
if (this.ItemsSource == null) return;
this.SelectedIndex = this.IndexOf(this.SelectedItem);
if (this.SelectedItemChangedCommand != null && this.SelectedItemChangedCommand.CanExecute(this.SelectedItem))
this.SelectedItemChangedCommand.Execute(this.SelectedItem);
}
19
View Source File : Picker.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void CommandCanExecuteChanged(object sender, EventArgs eventArgs)
{
ICommand cmd = SelectedItemChangedCommand;
if (cmd != null)
IsEnabled = cmd.CanExecute(this.SelectedItem);
}
19
View Source File : Slider.cs
License : MIT License
Project Creator : angelobelchior
License : MIT License
Project Creator : angelobelchior
private void CommandCanExecuteChanged(object sender, EventArgs eventArgs)
{
ICommand cmd = ValueChangedCommand;
if (cmd != null)
IsEnabled = cmd.CanExecute(ValueChangedCommandParameter);
}
19
View Source File : EventToCommandBehavior.cs
License : MIT License
Project Creator : anjoy8
License : MIT License
Project Creator : anjoy8
private void OnFired(object sender, EventArgs eventArgs)
{
if (Command == null)
return;
var parameter = CommandParameter;
if (eventArgs != null && eventArgs != EventArgs.Empty)
{
parameter = eventArgs;
if (EventArgsConverter != null)
{
parameter = EventArgsConverter.Convert(eventArgs, typeof(object), EventArgsConverterParameter, CultureInfo.CurrentUICulture);
}
}
if (Command.CanExecute(parameter))
{
Command.Execute(parameter);
}
}
19
View Source File : ControlDoubleClickBehavior.cs
License : Apache License 2.0
Project Creator : AnkiUniversal
License : Apache License 2.0
Project Creator : AnkiUniversal
static void control_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var control = sender as Control;
if(control != null)
{
var command = control.GetValue(ExecuteCommand) as ICommand;
var commandParameter = control.GetValue(ExecuteCommandParameter);
if (command.CanExecute(e))
{
command.Execute(commandParameter);
}
}
}
19
View Source File : ContextMenuItem.cs
License : MIT License
Project Creator : anpin
License : MIT License
Project Creator : anpin
internal void OnItemTapped()
{
ItemTapped?.Invoke(this, new EventArgs());
if (Command?.CanExecute(CommandParameter) ?? false && IsEnabled)
{
Command.Execute(CommandParameter);
}
}
19
View Source File : WindowClosingBehaviour.cs
License : MIT License
Project Creator : AntonyCorbett
License : MIT License
Project Creator : AntonyCorbett
private static void OnWindowClosing(object sender, CancelEventArgs e)
{
var closing = GetClosing(sender as Window);
if (closing != null)
{
if (closing.CanExecute(null))
{
closing.Execute(null);
}
else
{
var cancelClosing = GetCancelClosing(sender as Window);
cancelClosing?.Execute(null);
e.Cancel = true;
}
}
}
19
View Source File : ARFlatGroupAdapter.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
protected virtual void ExecuteCommandOnItem(ICommand command, object itemDataContext)
{
if (command?.CanExecute(itemDataContext) == true && itemDataContext != null)
{
command.Execute(itemDataContext);
}
}
19
View Source File : BaseCollectionViewSource.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
public override void WillDisplayCell(UICollectionView collectionView, UICollectionViewCell cell, NSIndexPath indexPath)
{
if ((indexPath.Row >= (ItemsSource.Count() - FromBottomCellStartLoadingIndex)) && MoreCommand != null && MoreCommand.CanExecute(null))
MoreCommand.Execute(null);
}
19
View Source File : BaseTableViewSource.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
public override void WillDisplay(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
if ((indexPath.Row >= (ItemsSource.Count() - FromBottomCellStartLoadingIndex)) &&
LoadMoreCommand != null && LoadMoreCommand.CanExecute(null))
{
LoadMoreCommand.Execute(null);
}
}
19
View Source File : BindableWebVIew.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
private void HandleLoadFinished(object sender, EventArgs ev)
{
var url = Url?.ToString();
var command = this.LoadFinishedCommand;
if (command != null && command.CanExecute(url))
command.Execute(url);
}
19
View Source File : ARLinearLayoutAdapter.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
public void OnClick(View view)
{
if (view?.Tag is IMvxLisreplacedemView mvxLisreplacedemView && (ItemClick?.CanExecute(mvxLisreplacedemView.DataContext) ?? false))
{
ItemClick?.Execute(mvxLisreplacedemView.DataContext);
}
}
19
View Source File : ARSimpleFragmentPagerAdapter.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
protected virtual void ExecuteCommandOnItem(ICommand command, object dataContext)
{
if (command == null)
return;
var item = dataContext;
if (item == null)
return;
if (!command.CanExecute(item))
return;
command.Execute(item);
}
19
View Source File : ARViewPager.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
protected virtual void ExecuteCommand(ICommand command, object parameter)
{
if (command == null)
return;
if (!command.CanExecute(parameter))
return;
command.Execute(parameter);
}
19
View Source File : BindableMKMapView.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
protected void OnItemSelected(T item)
{
SelectedItem = item;
if (SelectionChangedCommand != null && SelectionChangedCommand.CanExecute(item))
SelectionChangedCommand.Execute(item);
}
19
View Source File : BasketTableSource.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
if (editingStyle == UITableViewCellEditingStyle.Delete && DeleteItemCommand != null)
{
var item = GereplacedemAt(indexPath) as IBaskereplacedemVM;
if (item != null && DeleteItemCommand.CanExecute(item))
DeleteItemCommand.Execute(item);
}
}
19
View Source File : LinkerPleaseInclude.cs
License : Apache License 2.0
Project Creator : AppRopio
License : Apache License 2.0
Project Creator : AppRopio
public void Include(ICommand command)
{
command.CanExecuteChanged += (s, e) => { if (command.CanExecute(null)) command.Execute(null); };
}
19
View Source File : AudioPostControl.xaml.cs
License : Apache License 2.0
Project Creator : artemshuba
License : Apache License 2.0
Project Creator : artemshuba
private void TracksListView_ItemClick(object sender, ItemClickEventArgs e)
{
var track = (IAudio)e.ClickedItem;
var container = new AudioContainer() { Track = track, Tracklist = AudioPost.Tracks };
if (Command?.CanExecute(container) == true)
Command?.Execute(container);
}
19
View Source File : AudioPostControl.xaml.cs
License : Apache License 2.0
Project Creator : artemshuba
License : Apache License 2.0
Project Creator : artemshuba
private void AuthorNameButton_Click(object sender, RoutedEventArgs e)
{
if (AuthorCommand?.CanExecute(AudioPost) == true)
AuthorCommand?.Execute(AudioPost);
}
19
View Source File : AudioPostControl.xaml.cs
License : Apache License 2.0
Project Creator : artemshuba
License : Apache License 2.0
Project Creator : artemshuba
private void PostDateButton_Click(object sender, RoutedEventArgs e)
{
if (PostCommand?.CanExecute(AudioPost) == true)
PostCommand?.Execute(AudioPost);
}
19
View Source File : TrackControl.xaml.cs
License : Apache License 2.0
Project Creator : artemshuba
License : Apache License 2.0
Project Creator : artemshuba
private void TrackControl_OnTapped(object sender, TappedRoutedEventArgs e)
{
if (Command?.CanExecute(CommandParameter) == true)
Command?.Execute(CommandParameter);
}
See More Examples