corelibraries-devexpress-dot-mvvm-dot-dxsplashscreenviewmodel-6858cb65.md
Specifies the additional data associated with the view model instance.
Namespace : DevExpress.Mvvm
Assembly : DevExpress.Mvvm.v25.2.dll
NuGet Packages : DevExpress.Mvvm, DevExpress.Win.Navigation
public object Tag { get; set; }
Public Property Tag As Object
| Type | Description |
|---|---|
| Object |
An object that contains the additional data is associated with the view model instance.
|
The example below illustrates how to pass a custom object to the splash screen:
SplashScreenManagerService.ViewModel = new DXSplashScreenViewModel() {
Tag = new CustomDataSplashScreenViewModel() {
Caption = "Custom Caption",
Message = "Custom Message"
}
};
SplashScreenManagerService.Show();
//...
public class CustomDataSplashScreenViewModel : ViewModelBase {
public string Caption {
get { return GetValue<string>(nameof(Caption)); }
set { SetValue(value, nameof(Caption)); }
}
public string Message {
get { return GetValue<string>(nameof(Message)); }
set { SetValue(value, nameof(Message)); }
}
}
SplashScreenManagerService.ViewModel = New DXSplashScreenViewModel() With {
.Tag = New CustomDataSplashScreenViewModel() With {
.Caption = "Custom Caption",
.Message = "Custom Message"
}
}
SplashScreenManagerService.Show()
Public Class CustomDataSplashScreenViewModel
Inherits ViewModelBase
Public Property Caption() As String
Get
Return GetValue(Of String)(NameOf(Caption))
End Get
Set(ByVal value As String)
SetValue(value, NameOf(Caption))
End Set
End Property
Public Property Message() As String
Get
Return GetValue(Of String)(NameOf(Message))
End Get
Set(ByVal value As String)
SetValue(value, NameOf(Message))
End Set
End Property
End Class
<dx:WaitIndicator DeferedVisibility="True" Content="{Binding Path=.}">
<dx:WaitIndicator.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Tag.Caption}" FontSize="20"/>
<TextBlock Text="{Binding Tag.Message}"/>
</StackPanel>
</DataTemplate>
</dx:WaitIndicator.ContentTemplate>
</dx:WaitIndicator>
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Tag property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
vm.IsIndeterminate = false;
vm.Tag = new DelegateCommand(CancelOperation, CanCancelOperation);
}
vm.IsIndeterminate = False
vm.Tag = New DelegateCommand(AddressOf CancelOperation, AddressOf CanCancelOperation)
End Sub
See Also