-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
148 additions
and
50 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
29 changes: 29 additions & 0 deletions
29
TwinpackVsixShared/Dialogs/Converters/CatalogIconUrlVisibilityConverter.cs
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,29 @@ | ||
using System; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
using System.Globalization; | ||
using Twinpack.Protocol.Api; | ||
|
||
namespace Twinpack.Dialogs | ||
{ | ||
public class CatalogIconUrlVisibilityConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return Visibility.Collapsed; | ||
|
||
if (value is CatalogItemGetResponse catalogItem) | ||
{ | ||
return catalogItem.Icon == null && catalogItem.IconUrl != null ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
|
||
return Visibility.Collapsed; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
TwinpackVsixShared/Dialogs/Converters/CatalogIconVisibilityConverter.cs
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,29 @@ | ||
using System; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
using System.Globalization; | ||
using Twinpack.Protocol.Api; | ||
|
||
namespace Twinpack.Dialogs | ||
{ | ||
public class CatalogIconVisibilityConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return Visibility.Collapsed; | ||
|
||
if (value is CatalogItemGetResponse catalogItem) | ||
{ | ||
return catalogItem.Icon == null ? Visibility.Collapsed : Visibility.Visible; | ||
} | ||
|
||
return Visibility.Collapsed; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
TwinpackVsixShared/Dialogs/Converters/CatalogNoIconVisibilityConverter.cs
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,29 @@ | ||
using System; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
using System.Globalization; | ||
using Twinpack.Protocol.Api; | ||
|
||
namespace Twinpack.Dialogs | ||
{ | ||
public class CatalogNoIconVisibilityConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return Visibility.Collapsed; | ||
|
||
if (value is CatalogItemGetResponse catalogItem) | ||
{ | ||
return catalogItem.IconUrl == null && catalogItem.Icon == null ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
|
||
return Visibility.Collapsed; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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