コード例 #1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public NetworkSettingViewModel()
        {
            collectNetworkInformation();

            // DataGrid の行が選択された時の動作
            SelectedIndex.Subscribe(idx => {
                this.NetworkInfoList.ForEach(info => info.Selected.Value = string.Empty);
                if (idx != -1)
                {
                    this.NetworkInfoList[idx].Selected.Value = "*";
                    this.InterfaceName.Value = this.NetworkInfoList[idx].InterfaceName.Value;
                    this.IPAddress.Value     = this.NetworkInfoList[idx].IPAddress.Value;
                    if (_notification != null)
                    {
                        var notification         = _notification as NetworkSettingNotification;
                        notification.LocalHostIP = this.IPAddress.Value;
                    }
                }
            });

            OkCommand     = new DelegateCommand(OKInteraction);
            CancelCommand = new DelegateCommand(CancelInteraction);
        }