public void UpdateDeviceIcon() { var icon = DeviceIconManager.LoadIcon(this._Peer.storage.MACAddress); var resourceName = icon.Icon.ToResourceName(); // imgDeviceIcon.Source = (ImageSource)FindResource(resourceName); this.lblMACAddress.Content = Peer.storage.MACAddress; this.lblIPAddress.Content = Peer.storage.IPAddress; this.cbIsStatick.IsChecked = Peer.isSetIP; this.imgDeviceIcon.IsEnabled = Peer.isActive; lblDisplayName.Text = Peer.storage.HostName; }
private void btnChangeIcon_Click(object sender, RoutedEventArgs e) { var dialog = new DeviceIconPicker(lblDisplayName.Content.ToString()); dialog.SelectedIcon = DeviceIconManager.LoadIcon(this.PeerDevice.Peer.storage.MACAddress).Icon; dialog.Owner = this; if (dialog.ShowDialog() == true) { DeviceIconManager.SaveIcon(this.PeerDevice.Peer.storage.MACAddress, dialog.SelectedIcon); this.PeerDevice.UpdateDeviceIcon(); UpdateDisplay(); } }