-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**experimental** *proper* fix for virtualbox biosdate bug refined xaml structure
- Loading branch information
1 parent
6771470
commit e4a60b5
Showing
15 changed files
with
767 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace VMGuide | ||
{ | ||
//boolean转是否为collapse | ||
//true<->visible false<->collapse | ||
public sealed class BooleanToCollapseConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
return (value is bool) ? ((bool)value ? Visibility.Visible : Visibility.Collapsed) : Visibility.Visible; | ||
} | ||
public object ConvertBack(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
return (value is Visibility) ? (value.Equals(Visibility.Visible) ? true : false) : false; | ||
} | ||
} | ||
|
||
//boolean取反 | ||
public sealed class BooleanReverseConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
return (value is bool) ? !((bool)value) : false; | ||
} | ||
public object ConvertBack(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
return (value is bool) ? !((bool)value) : false; | ||
} | ||
} | ||
|
||
//boolean转是否为collapse,与BooleanToCollapseConverter结果相反 | ||
//true<->collapse false<->visible | ||
public sealed class BooleanReverseToCollapseConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
var val = (value is bool) ? !((bool)value) : false; | ||
return val ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
public object ConvertBack(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
return (value is Visibility) ? (value.Equals(Visibility.Visible) ? false : true) : false; | ||
} | ||
} | ||
|
||
//VMware中设定值与对应的描述文本互相转换 | ||
public sealed class VMwareValueToDescriptionConverter : IValueConverter | ||
{ | ||
|
||
public object Convert(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
if (value == null) { return ""; } else { return VMware.ValueToDescripton(value.ToString()); } | ||
|
||
} | ||
public object ConvertBack(object value, Type type, object para, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.