Back to Devexpress

DXSplashScreenViewModel.Tag Property

corelibraries-devexpress-dot-mvvm-dot-dxsplashscreenviewmodel-6858cb65.md

latest4.6 KB
Original Source

DXSplashScreenViewModel.Tag Property

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

Declaration

csharp
public object Tag { get; set; }
vb
Public Property Tag As Object

Property Value

TypeDescription
Object

An object that contains the additional data is associated with the view model instance.

|

Remarks

The example below illustrates how to pass a custom object to the splash screen:

csharp
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)); }
    }
}
vb
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
xaml
<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.

wpf-splash-screen-show-cancelable-wait-indicator/CS/SplashScreenManagerExample/ViewModels/MainViewModel.cs#L73

csharp
vm.IsIndeterminate = false;
    vm.Tag = new DelegateCommand(CancelOperation, CanCancelOperation);
}

wpf-splash-screen-show-cancelable-wait-indicator/VB/SplashScreenManagerExample/ViewModels/MainViewModel.vb#L80

vb
vm.IsIndeterminate = False
    vm.Tag = New DelegateCommand(AddressOf CancelOperation, AddressOf CanCancelOperation)
End Sub

See Also

DXSplashScreenViewModel Class

DXSplashScreenViewModel Members

DevExpress.Mvvm Namespace