-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Double click video to maximize camera
Implement functionality to double click video to maximize video. Double click again to restore default layout MainViewModel moved to seperate .cs file
- Loading branch information
mattw01
authored and
mattw01
committed
Apr 26, 2019
1 parent
f5ec4f2
commit 99a0a5e
Showing
9 changed files
with
339 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Input; | ||
|
||
namespace TeslaCamViewer | ||
{ | ||
public class DelegateCommand : ICommand | ||
{ | ||
private readonly Predicate<object> _canExecute; | ||
private readonly Action<object> _execute; | ||
|
||
public event EventHandler CanExecuteChanged; | ||
|
||
public DelegateCommand(Action<object> execute) | ||
: this(execute, null) | ||
{ | ||
} | ||
|
||
public DelegateCommand(Action<object> execute, | ||
Predicate<object> canExecute) | ||
{ | ||
_execute = execute; | ||
_canExecute = canExecute; | ||
} | ||
|
||
public bool CanExecute(object parameter) | ||
{ | ||
if (_canExecute == null) | ||
{ | ||
return true; | ||
} | ||
|
||
return _canExecute(parameter); | ||
} | ||
|
||
public void Execute(object parameter) | ||
{ | ||
_execute(parameter); | ||
} | ||
|
||
public void RaiseCanExecuteChanged() | ||
{ | ||
if (CanExecuteChanged != null) | ||
{ | ||
CanExecuteChanged(this, EventArgs.Empty); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.