Skip to content

Commit

Permalink
All xaml commands to open folder or website replaced by HandyControl …
Browse files Browse the repository at this point in the history
…behaviors.
  • Loading branch information
DineshSolanki committed Aug 10, 2021
1 parent 845b129 commit 21da016
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
15 changes: 7 additions & 8 deletions FoliCon/Modules/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ public static async void CheckForUpdate(bool onlyShowIfUpdateAvailable = false)
/// <param name="path">if path is a URL it opens url in default browser, if path is File Or folder path it will be started.</param>
public static void StartProcess(string path)
{
Process.Start(new ProcessStartInfo
Process.Start(new ProcessStartInfo(path)
{
FileName = path,
UseShellExecute = true,
Verb = "open"
UseShellExecute = true
});
}

Expand Down Expand Up @@ -486,9 +484,10 @@ public static void BuildFolderIco(string iconMode, string filmFolderPath, string
IconOverlay.Faelpessoal => StaTask.Start(() => new PosterIconFaelpessoal(new PosterIcon(
filmFolderPath, rating,
ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()),
IconOverlay.FaelpessoalHorizontal => StaTask.Start(() => new PosterIconFaelpessoalHorizontal(new PosterIcon(
filmFolderPath, rating,
ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()),
IconOverlay.FaelpessoalHorizontal => StaTask.Start(() => new PosterIconFaelpessoalHorizontal(
new PosterIcon(
filmFolderPath, rating,
ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()),
_ => StaTask.Start(() =>
new Views.PosterIcon(new PosterIcon(filmFolderPath, rating, ratingVisibility, mockupVisibility))
.RenderToBitmap())
Expand Down Expand Up @@ -627,7 +626,7 @@ public static (string ID, string MediaType) ReadMediaInfo(string folderPath)

public static int GetResultCount(bool isPickedById, dynamic result, string searchMode)
{
return isPickedById ? result != null ? 1 : 0 : searchMode == "Game" ? result.Length : result.TotalResults;
return isPickedById ? result != null ? 1 : 0 : searchMode == "Game" ? result.Length : result.TotalResults;
}
}
}
10 changes: 5 additions & 5 deletions FoliCon/Views/AboutBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" Foreground="RoyalBlue" ScrollViewer.CanContentScroll="True" />
<TextBlock Text="{Binding AdditionalNotes}" Margin="0,5,0,0" />
<ContentControl VerticalAlignment="Top">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<i:InvokeCommandAction Command="{Binding WebsiteClickCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<hc:Interaction.Triggers>
<hc:EventTrigger EventName="MouseLeftButtonDown">
<hc:LaunchUriOrFileAction Path="{Binding Website}" />
</hc:EventTrigger>
</hc:Interaction.Triggers>
<TextBlock Text="{Binding Website}" HorizontalAlignment="Stretch" FontStyle="Oblique" Foreground="Blue" Margin="0,4,0,0" MouseEnter="TextBlock_MouseEnter" MouseLeave="TextBlock_MouseLeave" />
</ContentControl>
</StackPanel>
Expand Down
21 changes: 13 additions & 8 deletions FoliCon/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
xmlns:langs="clr-namespace:FoliCon.Properties.Langs"
xmlns:ex="clr-namespace:FoliCon.Modules.LangExtension"
xmlns:models="clr-namespace:FoliCon.Models"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
prism:ViewModelLocator.AutoWireViewModel="True"
Expand Down Expand Up @@ -85,8 +84,14 @@
ToolTip="{ex:Lang Key={x:Static langs:LangKeys.HaveIconsTooltip}}"
Command="{Binding CustomIconsCommand}" />
<MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.Help}}">
<MenuItem x:Name="MenubtnHelp" Header="{ex:Lang Key={x:Static langs:LangKeys.HelpDocument}}" Command="{Binding HelpCommand}" />
<MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.CheckForUpdate}}" Command="{Binding UpdateCommand}" />
<MenuItem x:Name="MenubtnHelp" Header="{ex:Lang Key={x:Static langs:LangKeys.HelpDocument}}" >
<hc:Interaction.Triggers>
<hc:EventTrigger EventName="Click">
<hc:LaunchUriOrFileAction Path="https://github.com/DineshSolanki/FoliCon" />
</hc:EventTrigger>
</hc:Interaction.Triggers>
</MenuItem>
<MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.CheckForUpdate}}" Command="{Binding UpdateCommand}" />
<MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.About}}" Command="{Binding AboutCommand}" />
</MenuItem>
</Menu>
Expand All @@ -103,11 +108,11 @@
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<ContentControl Grid.Row="1" HorizontalAlignment="Center" Grid.ColumnSpan="2" VerticalAlignment="Top">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding SelectedFolderDClickCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<hc:Interaction.Triggers>
<hc:EventTrigger EventName="MouseDoubleClick">
<hc:LaunchUriOrFileAction Path="{Binding SelectedFolder}" />
</hc:EventTrigger>
</hc:Interaction.Triggers>
<TextBlock Text="{Binding SelectedFolder}" HorizontalAlignment="Center" VerticalAlignment="Top"
FontStyle="Italic" Foreground="Black">
</TextBlock>
Expand Down
10 changes: 8 additions & 2 deletions FoliCon/Views/SearchResult.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@
Text="{Binding Path=SelectedItem.(models:ListItem.Overview), ElementName=ListViewResult}" TextWrapping="Wrap"
FontSize="{Binding Value, ElementName=SizeSlider}" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" IsReadOnly="True" VerticalContentAlignment="Top" />
<ListBox Grid.Row="3" Grid.ColumnSpan="2" Grid.Column="0" ItemsSource="{Binding FileList}"
ScrollViewer.CanContentScroll="True" hc:ScrollViewer.HorizontalScrollBarVisibility="Auto" hc:Empty.ShowEmpty="true"/>
<ListBox x:Name="LstFolderContent" Grid.Row="3" Grid.ColumnSpan="2" Grid.Column="0" ItemsSource="{Binding FileList}"
ScrollViewer.CanContentScroll="True" hc:ScrollViewer.HorizontalScrollBarVisibility="Auto" hc:Empty.ShowEmpty="true">
<!--<hc:Interaction.Triggers>
<hc:EventTrigger EventName="MouseDoubleClick">
<hc:LaunchUriOrFileAction Path="{Binding ElementName=LstFolderContent, Path=SelectedItem}"/>
</hc:EventTrigger>
</hc:Interaction.Triggers>-->
</ListBox>
</Grid>
</Grid>
</hc:BusyIndicator>
Expand Down
10 changes: 0 additions & 10 deletions FoliCon/Views/SearchResult.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,5 @@ private void Sort(string sortBy, ListSortDirection direction)
dataView.SortDescriptions.Add(sd);
dataView.Refresh();
}

private void ListViewResult_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var dataContext = ((FrameworkElement)e.OriginalSource).DataContext;

if (dataContext is ListItem)
{
MessageBox.Show("Item's Double Click handled!");
}
}
}
}

0 comments on commit 21da016

Please sign in to comment.