-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Displayed Header of Episode/Non-Episode Lists to allow resizing. Added
ConverterMagic so that the last columns always takes all available space. This closes #32.
- Loading branch information
1 parent
443bc64
commit 379aa34
Showing
4 changed files
with
65 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
|
||
//Code taken from: http://stackoverflow.com/questions/5573152/how-to-resize-a-certain-control-based-on-window-size-in-wpf#5573895 | ||
|
||
namespace SjUpdater.Utils | ||
{ | ||
public class GridViewWidthCalulationMultiConverter : IMultiValueConverter | ||
{ | ||
public object Convert(object[] values, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
// do some sort of calculation | ||
double totalWindowWidth; | ||
double otherColumnsTotalWidth = 0; | ||
double.TryParse(values[0].ToString(), out totalWindowWidth); | ||
var arrayOfColumns = values[1] as IList<GridViewColumn>; | ||
|
||
for (int i = 0; i < arrayOfColumns.Count - 1; i++) | ||
{ | ||
otherColumnsTotalWidth += arrayOfColumns[i].ActualWidth; | ||
} | ||
|
||
return (totalWindowWidth - otherColumnsTotalWidth) < 0 ? | ||
0 : (totalWindowWidth - otherColumnsTotalWidth); | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, | ||
object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |