Class ControllerViewModel
Virtual controller view model
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Input
Assembly: Phoenix.Plugin.Input.dll
Syntax
public class ControllerViewModel : INotifyPropertyChanged, IDisposable
Constructors
View SourceControllerViewModel(ControllerSelectorViewModel, IDevice, Int32)
Initializes a new instance of the ControllerViewModel class
Declaration
public ControllerViewModel(ControllerSelectorViewModel parent, IDevice device, int slot)
Parameters
Type | Name | Description |
---|---|---|
ControllerSelectorViewModel | parent | Parent view model |
IDevice | device | Device to attach to |
System.Int32 | slot | Slot to attach to |
Properties
View SourceBindWithUser
Gets or sets a command to bind with a specific user.
Declaration
public DelegateCommand<PhoenixUser> BindWithUser { get; set; }
Property Value
Type | Description |
---|---|
DelegateCommand<PhoenixUser> |
BindWithUserExclusive
Gets or sets a command to exclusively bind with a specific user.
Declaration
public DelegateCommand<PhoenixUser> BindWithUserExclusive { get; set; }
Property Value
Type | Description |
---|---|
DelegateCommand<PhoenixUser> |
ChangeLanguage
Gets or sets command to change language
Declaration
public DelegateCommand<string> ChangeLanguage { get; set; }
Property Value
Type | Description |
---|---|
DelegateCommand<System.String> |
ChangeSandbox
Gets or sets command to change sandbox
Declaration
public DelegateCommand<string> ChangeSandbox { get; set; }
Property Value
Type | Description |
---|---|
DelegateCommand<System.String> |
ChromeColor
Gets the chrome color depending on selection
Declaration
public Color ChromeColor { get; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Color |
Device
Gets the device the virtual controller is attached to
Declaration
public IDevice Device { get; }
Property Value
Type | Description |
---|---|
IDevice |
DisconnectController
Gets or sets command to disconnect controller
Declaration
public DelegateCommand DisconnectController { get; set; }
Property Value
Type | Description |
---|---|
DelegateCommand |
IsInErrorState
Gets a value indicating whether or not the gamepad is in a state where it cannot be used.
Declaration
public bool IsInErrorState { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSelected
Gets or sets a value indicating whether the controller has been picked
Declaration
public bool IsSelected { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Parent
Gets the parent view model
Declaration
public ControllerSelectorViewModel Parent { get; }
Property Value
Type | Description |
---|---|
ControllerSelectorViewModel |
RefreshUserBindings
Gets or sets a command to refresh user bindings.
Declaration
public DelegateCommand RefreshUserBindings { get; set; }
Property Value
Type | Description |
---|---|
DelegateCommand |
Slot
Gets or sets the slot the virtual controller is attached to
Declaration
public int Slot { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Status
Gets or sets the status for the virtual controller.
Declaration
public GamepadStatus Status { get; set; }
Property Value
Type | Description |
---|---|
GamepadStatus |
StatusMessage
Gets the status message for the gamepad.
Declaration
public string StatusMessage { get; }
Property Value
Type | Description |
---|---|
System.String |
SupportsUserBinding
Gets a value indicating whether or not the device supports user binding.
Declaration
public bool SupportsUserBinding { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Users
Gets the collection of users for a device.
Declaration
public ObservableCollection<PhoenixUser> Users { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<PhoenixUser> |
Methods
View SourceDisconnect()
Disconnects the virtual controller
Declaration
public void Disconnect()
Dispose()
Disposes the view model.
Declaration
public void Dispose()
HoldButton(GamepadButtons)
Presses a button
Declaration
public void HoldButton(GamepadButtons button)
Parameters
Type | Name | Description |
---|---|---|
GamepadButtons | button | Button to press and release |
MoveLeftTrigger(Double)
Moves the LeftTrigger
Declaration
public void MoveLeftTrigger(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to set to |
MoveRightTrigger(Double)
Sets the RightTrigger
Declaration
public void MoveRightTrigger(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to set to |
OnControllerError(Object, EventArgs)
Handle virtual gamepad errors
Declaration
protected void OnControllerError(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Sender object |
System.EventArgs | e | Event arguments |
OnControllerReconnect(Object, EventArgs)
Handle reconnection
Declaration
protected void OnControllerReconnect(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Sender object |
System.EventArgs | e | Event arguments |
Refresh(Dispatcher)
Updates the controller screenshot
Declaration
public void Refresh(Dispatcher dispatcher)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Threading.Dispatcher | dispatcher | Dispatcher to use for UI notifications |
ReleaseButton(GamepadButtons)
Release button
Declaration
public void ReleaseButton(GamepadButtons button)
Parameters
Type | Name | Description |
---|---|---|
GamepadButtons | button | Button to release |
SetLeftThumbStickX(Double)
Sets the Left Thumb Stick X
Declaration
public void SetLeftThumbStickX(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to set to |
SetLeftThumbStickY(Double)
Sets the Left Thumb Stick Y
Declaration
public void SetLeftThumbStickY(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to set to |
SetRightThumbStickX(Double)
Sets the Right Thumb Stick X
Declaration
public void SetRightThumbStickX(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to set to |
SetRightThumbStickY(Double)
Sets the Right Thumb Stick Y
Declaration
public void SetRightThumbStickY(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to set to |
Events
View SourcePropertyChanged
Property changed event required for INotifyPropertyChanged support
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |
SelectionChanged
Selection changed event
Declaration
public event EventHandler SelectionChanged
Event Type
Type | Description |
---|---|
System.EventHandler |