@@ -51,6 +51,22 @@ public class IpConfigItemViewModel : ViewModelBase
5151 private bool _isExpanded = false ;
5252 public bool IsExpanded { get => _isExpanded ; set { _isExpanded = value ; OnPropertyChanged ( nameof ( IsExpanded ) ) ; } }
5353
54+ private bool _confidentialMode = false ;
55+ public bool ConfidentialMode
56+ {
57+ get => _confidentialMode ;
58+ set
59+ {
60+ _confidentialMode = value ;
61+ OnPropertyChanged ( nameof ( ConfidentialMode ) ) ;
62+ foreach ( var item in Details )
63+ {
64+ item . ConfidentialMode = value ;
65+ }
66+ IsExpanded = ! value && IsExpanded ;
67+ }
68+ }
69+
5470 private SolidColorBrush ? _statusBrush ;
5571 public SolidColorBrush ? StatusBrush { get => _statusBrush ; set { _statusBrush = value ; OnPropertyChanged ( nameof ( StatusBrush ) ) ; } }
5672
@@ -89,12 +105,12 @@ public IpConfigItemViewModel(WindowsIpConfig ipConfig)
89105
90106 Details = [
91107 new ( Properties . Resources . DNSSuffix , _ipConfig . DNSSuffix ?? Properties . Resources . Unknown , 0 , 0 ) ,
92- new ( Properties . Resources . IPv4Address , _ipConfig . IPv4Address ?? Properties . Resources . Unknown , 1 , 0 ) ,
93- new ( Properties . Resources . IPv6Address , _ipConfig . IPv6Address ?? Properties . Resources . Unknown , 0 , 1 ) ,
94- new ( Properties . Resources . SubnetMask , _ipConfig . IPv4Mask ?? Properties . Resources . Unknown , 1 , 1 ) ,
108+ new ( Properties . Resources . IPv4Address , _ipConfig . IPv4Address ?? Properties . Resources . Unknown , 1 , 0 , true ) ,
109+ new ( Properties . Resources . IPv6Address , _ipConfig . IPv6Address ?? Properties . Resources . Unknown , 0 , 1 , true ) ,
110+ new ( Properties . Resources . SubnetMask , _ipConfig . IPv4Mask ?? Properties . Resources . Unknown , 1 , 1 , true ) ,
95111 ] ;
96112
97- if ( ! string . IsNullOrEmpty ( _ipConfig . IPv4Gateway ) ) Details . Add ( new GridItemViewModel ( Properties . Resources . GatewayIPv4 , _ipConfig . IPv4Gateway , 2 , 0 ) ) ;
98- if ( ! string . IsNullOrEmpty ( _ipConfig . IPv6Gateway ) ) Details . Add ( new GridItemViewModel ( Properties . Resources . GatewayIPv6 , _ipConfig . IPv6Gateway , 2 , 1 ) ) ;
113+ if ( ! string . IsNullOrEmpty ( _ipConfig . IPv4Gateway ) ) Details . Add ( new GridItemViewModel ( Properties . Resources . GatewayIPv4 , _ipConfig . IPv4Gateway , 2 , 0 , true ) ) ;
114+ if ( ! string . IsNullOrEmpty ( _ipConfig . IPv6Gateway ) ) Details . Add ( new GridItemViewModel ( Properties . Resources . GatewayIPv6 , _ipConfig . IPv6Gateway , 2 , 1 , true ) ) ;
99115 }
100116}
0 commit comments