The root view for Cloud SQL for the Cloud Explorer.
Inheritance: GoogleCloudExtension.CloudExplorer.SourceRootViewModelBase
Ejemplo n.º 1
0
        public InstanceViewModel(CloudSQLSourceRootViewModel owner, DatabaseInstance instance)
        {
            _owner    = owner;
            _instance = instance;
            _item     = new Lazy <InstanceItem>(GetItem);
            _openAddDataConnectionDialog = new WeakCommand(OpenDataConnectionDialog);

            Caption = _instance.Name;

            var menuItems = new List <MenuItem>
            {
                new MenuItem {
                    Header = Resources.CloudExplorerSqlOpenAddDataConnectionMenuHeader, Command = _openAddDataConnectionDialog
                },
                new MenuItem {
                    Header = Resources.UiOpenOnCloudConsoleMenuHeader, Command = new WeakCommand(OnOpenOnCloudConsoleCommand)
                },
                new MenuItem {
                    Header = Resources.UiPropertiesMenuHeader, Command = new WeakCommand(OnPropertiesCommand)
                },
            };

            ContextMenu = new ContextMenu {
                ItemsSource = menuItems
            };

            UpdateIcon();
        }
        public InstanceViewModel(CloudSQLSourceRootViewModel owner, DatabaseInstance instance)
        {
            _owner    = owner;
            _instance = instance;

            Caption = Instance.Name;

            UpdateMenu();
            UpdateIcon();
        }