@@ -112,6 +112,7 @@ public NetworkInterfaceInfo SelectedNetworkInterface
112112 if ( ! _isLoading )
113113 SettingsManager . Current . NetworkInterface_SelectedInterfaceId = value . Id ;
114114
115+ // Details
115116 DetailsName = value . Name ;
116117 DetailsDescription = value . Description ;
117118 DetailsType = value . Type ;
@@ -121,16 +122,43 @@ public NetworkInterfaceInfo SelectedNetworkInterface
121122 DetailsIPv4Address = value . IPv4Address ;
122123 DetailsSubnetmask = value . Subnetmask ;
123124 DetailsIPv4Gateway = value . IPv4Gateway ;
124- DetailsIsIPv4DhcpEnabled = value . IsDhcpEnabled ;
125- DetailsIsIPv4DhcpServer = value . DhcpServer ;
125+ DetailsIPv4DhcpEnabled = value . DhcpEnabled ;
126+ DetailsIPv4DhcpServer = value . DhcpServer ;
126127 DetailsDhcpLeaseObtained = value . DhcpLeaseObtained ;
127128 DetailsDhcpLeaseExpires = value . DhcpLeaseExpires ;
128129 DetailsIPv6AddressLinkLocal = value . IPv6AddressLinkLocal ;
129130 DetailsIPv6Address = value . IPv6Address ;
130131 DetailsIPv6Gateway = value . IPv6Gateway ;
132+ DetailsDnsAutoconfigurationEnabled = value . DnsAutoconfigurationEnabled ;
131133 DetailsDnsSuffix = value . DnsSuffix ;
132134 DetailsDnsServer = value . DnsServer ;
133135
136+ // Configuration
137+ if ( value . DhcpEnabled )
138+ {
139+ ConfigEnableDynamicIPAddress = true ;
140+ }
141+ else
142+ {
143+ ConfigEnableStaticIPAddress = true ;
144+ ConfigIPAddress = value . IPv4Address . FirstOrDefault ( ) . ToString ( ) ;
145+ ConfigSubnetmaskOrCidr = value . Subnetmask . FirstOrDefault ( ) . ToString ( ) ;
146+ ConfigGateway = value . IPv4Gateway . FirstOrDefault ( ) . ToString ( ) ;
147+ }
148+
149+ if ( value . DnsAutoconfigurationEnabled )
150+ {
151+ ConfigEnableDynamicDns = true ;
152+ }
153+ else
154+ {
155+ ConfigEnableStaticDns = true ;
156+
157+ List < IPAddress > dnsServers = value . DnsServer . Where ( x => x . AddressFamily == System . Net . Sockets . AddressFamily . InterNetwork ) . ToList ( ) ;
158+ ConfigPrimaryDnsServer = dnsServers . Count > 0 ? dnsServers [ 0 ] . ToString ( ) : string . Empty ;
159+ ConfigSecondaryDnsServer = dnsServers . Count > 1 ? dnsServers [ 1 ] . ToString ( ) : string . Empty ;
160+ }
161+
134162 CanConfigure = value . IsOperational ;
135163 }
136164
@@ -267,30 +295,30 @@ public IPAddress[] DetailsIPv4Gateway
267295 }
268296 }
269297
270- private bool _detailsIsIPv4DhcpEnabled ;
271- public bool DetailsIsIPv4DhcpEnabled
298+ private bool _detailsIPv4DhcpEnabled ;
299+ public bool DetailsIPv4DhcpEnabled
272300 {
273- get { return _detailsIsIPv4DhcpEnabled ; }
301+ get { return _detailsIPv4DhcpEnabled ; }
274302 set
275303 {
276- if ( value == _detailsIsIPv4DhcpEnabled )
304+ if ( value == _detailsIPv4DhcpEnabled )
277305 return ;
278306
279- _detailsIsIPv4DhcpEnabled = value ;
307+ _detailsIPv4DhcpEnabled = value ;
280308 OnPropertyChanged ( ) ;
281309 }
282310 }
283311
284- private IPAddress [ ] _detailsIsIPv4DhcpServer ;
285- public IPAddress [ ] DetailsIsIPv4DhcpServer
312+ private IPAddress [ ] _detailsIPv4DhcpServer ;
313+ public IPAddress [ ] DetailsIPv4DhcpServer
286314 {
287- get { return _detailsIsIPv4DhcpServer ; }
315+ get { return _detailsIPv4DhcpServer ; }
288316 set
289317 {
290- if ( value == _detailsIsIPv4DhcpServer )
318+ if ( value == _detailsIPv4DhcpServer )
291319 return ;
292320
293- _detailsIsIPv4DhcpServer = value ;
321+ _detailsIPv4DhcpServer = value ;
294322 OnPropertyChanged ( ) ;
295323 }
296324 }
@@ -366,6 +394,20 @@ public IPAddress[] DetailsIPv6Gateway
366394 }
367395 }
368396
397+ private bool _detailsDnsAutoconfigurationEnabled ;
398+ public bool DetailsDnsAutoconfigurationEnabled
399+ {
400+ get { return _detailsDnsAutoconfigurationEnabled ; }
401+ set
402+ {
403+ if ( value == _detailsDnsAutoconfigurationEnabled )
404+ return ;
405+
406+ _detailsDnsAutoconfigurationEnabled = value ;
407+ OnPropertyChanged ( ) ;
408+ }
409+ }
410+
369411 private string _detailsDnsSuffix ;
370412 public string DetailsDnsSuffix
371413 {
@@ -594,7 +636,7 @@ public NetworkInterfaceViewModel(IDialogCoordinator instance)
594636
595637 _isLoading = false ;
596638 }
597-
639+
598640 private async void LoadNetworkInterfaces ( )
599641 {
600642 IsNetworkInterfaceLoading = true ;
@@ -680,7 +722,7 @@ public async void ApplyNetworkInterfaceConfigAction()
680722 } ;
681723
682724 try
683- {
725+ {
684726 Models . Network . NetworkInterface networkInterface = new Models . Network . NetworkInterface ( ) ;
685727
686728 networkInterface . UserHasCanceled += NetworkInterface_UserHasCanceled ;
0 commit comments