Repository: sourcechord/GridExtra
Branch: master
Commit: 0e516468b8bb
Files: 44
Total size: 148.0 KB
Directory structure:
gitextract_enuf11w3/
├── .gitignore
├── GridExtra.Shared/
│ ├── BreakPoints.cs
│ ├── GridEx.cs
│ ├── GridExtra.Shared.projitems
│ ├── GridExtra.Shared.shproj
│ ├── ResponsiveGrid.Properties.cs
│ └── ResponsiveGrid.cs
├── GridExtra.Uwp/
│ ├── GridExtra.Uwp.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── GridExtra.Uwp.rd.xml
│ └── project.json
├── GridExtra.Wpf/
│ ├── BreakPointsTypeConverter.cs
│ ├── GridExtra.Wpf.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── WrapPanelEx.cs
├── GridExtra.sln
├── LICENSE
├── Nuget/
│ ├── GridExtra.nuspec
│ └── pack.bat
├── README.md
└── Sample/
├── BasicSample.Uwp/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── BasicSample.Uwp.csproj
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── project.json
└── BasicSample.Wpf/
├── App.config
├── App.xaml
├── App.xaml.cs
├── BasicSample.Wpf.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
└── Properties/
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
================================================
FILE: GridExtra.Shared/BreakPoints.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if WINDOWS_WPF
using System.Windows;
using System.Windows.Controls;
using System.ComponentModel;
#elif WINDOWS_UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
#endif
namespace SourceChord.GridExtra
{
#if WINDOWS_WPF
[TypeConverter(typeof(BreakPointsTypeConverter))]
#endif
public class BreakPoints : DependencyObject
{
public double XS_SM
{
get { return (double)GetValue(XS_SMProperty); }
set { SetValue(XS_SMProperty, value); }
}
// Using a DependencyProperty as the backing store for XS_SM. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_SMProperty =
DependencyProperty.Register("XS_SM", typeof(double), typeof(BreakPoints), new PropertyMetadata(768.0));
public double SM_MD
{
get { return (double)GetValue(SM_MDProperty); }
set { SetValue(SM_MDProperty, value); }
}
// Using a DependencyProperty as the backing store for SM_MD. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_MDProperty =
DependencyProperty.Register("SM_MD", typeof(double), typeof(BreakPoints), new PropertyMetadata(992.0));
public double MD_LG
{
get { return (double)GetValue(MD_LGProperty); }
set { SetValue(MD_LGProperty, value); }
}
// Using a DependencyProperty as the backing store for MD_LG. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_LGProperty =
DependencyProperty.Register("MD_LG", typeof(double), typeof(BreakPoints), new PropertyMetadata(1200.0));
public BreakPoints()
{
}
}
}
================================================
FILE: GridExtra.Shared/GridEx.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
#if WINDOWS_WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif WINDOWS_UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
#endif
namespace SourceChord.GridExtra
{
#if WINDOWS_WPF
using LayoutUpdateEventHandler = EventHandler;
#elif WINDOWS_UWP
using LayoutUpdateEventHandler = EventHandler<object>;
#else
#endif
public class AreaDefinition
{
public int Row { get; set; }
public int Column { get; set; }
public int RowSpan { get; set; }
public int ColumnSpan { get; set; }
public AreaDefinition(int row, int column, int rowSpan, int columnSpan)
{
this.Row = row;
this.Column = column;
this.RowSpan = rowSpan;
this.ColumnSpan = columnSpan;
}
}
public class NamedAreaDefinition : AreaDefinition
{
public string Name { get; set; }
public NamedAreaDefinition(string name, int row, int column, int rowSpan, int columnSpan)
: base(row, column, rowSpan, columnSpan)
{
this.Name = name;
}
}
struct GridLengthDefinition
{
public GridLength GridLength;
public double? Min;
public double? Max;
}
public static class GridEx
{
public static Orientation GetAutoFillOrientation(DependencyObject obj)
{
return (Orientation)obj.GetValue(AutoFillOrientationProperty);
}
public static void SetAutoFillOrientation(DependencyObject obj, Orientation value)
{
obj.SetValue(AutoFillOrientationProperty, value);
}
// Using a DependencyProperty as the backing store for AutoFillOrientation. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AutoFillOrientationProperty =
DependencyProperty.RegisterAttached("AutoFillOrientation", typeof(Orientation), typeof(GridEx), new PropertyMetadata(Orientation.Horizontal));
public static bool GetAutoFillChildren(DependencyObject obj)
{
return (bool)obj.GetValue(AutoFillChildrenProperty);
}
public static void SetAutoFillChildren(DependencyObject obj, bool value)
{
obj.SetValue(AutoFillChildrenProperty, value);
}
// Using a DependencyProperty as the backing store for AutoFillChildren. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AutoFillChildrenProperty =
DependencyProperty.RegisterAttached("AutoFillChildren", typeof(bool), typeof(GridEx), new PropertyMetadata(false, OnAutoFillChildrenChanged));
private static void OnAutoFillChildrenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = d as Grid;
var isEnabled = (bool)e.NewValue;
if (grid == null) { return; }
if (isEnabled)
{
var layoutUpdateCallback = CreateLayoutUpdateHandler(grid);
// イベントの登録
grid.LayoutUpdated += layoutUpdateCallback;
SetLayoutUpdatedCallback(grid, layoutUpdateCallback);
// AutoFill処理を行う
AutoFill(grid);
}
else
{
// イベントの解除
var callback = GetLayoutUpdatedCallback(grid);
grid.LayoutUpdated -= callback;
// AutoFill処理のリセット
ClearAutoFill(grid);
}
}
private static LayoutUpdateEventHandler CreateLayoutUpdateHandler(Grid grid)
{
var prevCount = 0;
var prevColumn = grid.ColumnDefinitions.Count;
var prevRow = grid.RowDefinitions.Count;
var prevOrientation = GetAutoFillOrientation(grid);
var layoutUpdateCallback = new LayoutUpdateEventHandler((sender, args) =>
{
var count = grid.Children.Count;
var column = grid.ColumnDefinitions.Count;
var row = grid.RowDefinitions.Count;
var orientation = GetAutoFillOrientation(grid);
if (count != prevCount ||
column != prevColumn ||
row != prevRow ||
orientation != prevOrientation)
{
AutoFill(grid);
prevCount = count;
prevColumn = column;
prevRow = row;
prevOrientation = orientation;
}
});
return layoutUpdateCallback;
}
public static LayoutUpdateEventHandler GetLayoutUpdatedCallback(DependencyObject obj)
{
return (LayoutUpdateEventHandler)obj.GetValue(LayoutUpdatedCallbackProperty);
}
private static void SetLayoutUpdatedCallback(DependencyObject obj, LayoutUpdateEventHandler value)
{
obj.SetValue(LayoutUpdatedCallbackProperty, value);
}
// Using a DependencyProperty as the backing store for LayoutUpdatedCallback. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LayoutUpdatedCallbackProperty =
DependencyProperty.RegisterAttached("LayoutUpdatedCallback", typeof(LayoutUpdateEventHandler), typeof(GridEx), new PropertyMetadata(null));
private static void AutoFill(Grid grid)
{
var isEnabled = GetAutoFillChildren(grid);
var rowCount = grid.RowDefinitions.Count;
var columnCount = grid.ColumnDefinitions.Count;
var orientation = GetAutoFillOrientation(grid);
if (!isEnabled || rowCount == 0 || columnCount == 0) return;
var area = new bool[rowCount, columnCount];
var autoLayoutList = new List<FrameworkElement>();
// Grid内の位置固定要素のチェック
foreach (FrameworkElement child in grid.Children)
{
// AreaName ⇒ Areaの優先順位で、グリッド位置の設定を行う
var region = GetAreaNameRegion(child) ?? GetAreaRegion(child);
var isFixed = region != null;
if (isFixed)
{
// 位置指定されているので、AutoFillReservedAreaに記録する
var row = region.Row;
var column = region.Column;
var rowSpan = region.RowSpan;
var columnSpan = region.ColumnSpan;
for (var i = row; i < row + rowSpan; i++)
for (var j = column; j < column + columnSpan; j++)
{
if (columnCount <= j || rowCount <= i) { continue; }
area[i, j] = true;
}
}
else
{
// Gridの位置未設定の要素は、自動レイアウト対象としてリストに追加
autoLayoutList.Add(child);
}
}
var count = 0;
var numOfCell = rowCount * columnCount;
var isHorizontal = orientation == Orientation.Horizontal;
var isOverflow = false;
// Gridの子要素を、順番にGrid内に並べていく
foreach (FrameworkElement child in autoLayoutList)
{
// Visibility.Collapsedの項目は除外する
if (child.Visibility == Visibility.Collapsed)
{
continue;
}
while (true)
{
var x = isHorizontal ? count % columnCount : count / rowCount;
var y = isHorizontal ? count / columnCount : count % rowCount;
var canArrange = isOverflow ? true : !area[y, x];
if (canArrange)
{
Grid.SetRow(child, y);
Grid.SetColumn(child, x);
Grid.SetRowSpan(child, 1);
Grid.SetColumnSpan(child, 1);
}
if (count + 1 < numOfCell)
{
count++;
}
else
{
isOverflow = true;
}
if (canArrange)
{
break;
}
}
}
}
private static void ClearAutoFill(Grid grid)
{
foreach (FrameworkElement child in grid.Children)
{
child.ClearValue(Grid.RowProperty);
child.ClearValue(Grid.ColumnProperty);
child.ClearValue(Grid.RowSpanProperty);
child.ClearValue(Grid.ColumnSpanProperty);
UpdateItemPosition(child);
}
}
public static string GetColumnDefinition(DependencyObject obj)
{
return (string)obj.GetValue(ColumnDefinitionProperty);
}
public static void SetColumnDefinition(DependencyObject obj, string value)
{
obj.SetValue(ColumnDefinitionProperty, value);
}
// Using a DependencyProperty as the backing store for ColumnDefinition. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ColumnDefinitionProperty =
DependencyProperty.RegisterAttached("ColumnDefinition", typeof(string), typeof(GridEx), new PropertyMetadata(null, OnColumnDefinitionChanged));
private static void OnColumnDefinitionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = d as Grid;
var param = e.NewValue as string;
InitializeColumnDefinition(grid, param);
var template = GetTemplateArea(grid);
if (template != null)
{
InitializeTemplateArea(grid, template);
}
}
private static void InitializeColumnDefinition(Grid grid, string param)
{
if (grid == null || param == null)
{
return;
}
grid.ColumnDefinitions.Clear();
var list = param.Split(',')
.Select(o => o.Trim());
foreach (var item in list)
{
var def = StringToGridLengthDefinition(item);
var columnDefinition = new ColumnDefinition() { Width = def.GridLength };
if (def.Max != null) { columnDefinition.MaxWidth = def.Max.Value; }
if (def.Min != null) { columnDefinition.MinWidth = def.Min.Value; }
grid.ColumnDefinitions.Add(columnDefinition);
}
}
public static string GetRowDefinition(DependencyObject obj)
{
return (string)obj.GetValue(RowDefinitionProperty);
}
public static void SetRowDefinition(DependencyObject obj, string value)
{
obj.SetValue(RowDefinitionProperty, value);
}
// Using a DependencyProperty as the backing store for RowDefinition. This enables animation, styling, binding, etc...
public static readonly DependencyProperty RowDefinitionProperty =
DependencyProperty.RegisterAttached("RowDefinition", typeof(string), typeof(GridEx), new PropertyMetadata(null, OnRowDefinitionChanged));
private static void OnRowDefinitionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = d as Grid;
var param = e.NewValue as string;
InitializeRowDefinition(grid, param);
var template = GetTemplateArea(grid);
if (template != null)
{
InitializeTemplateArea(grid, template);
}
}
private static void InitializeRowDefinition(Grid grid, string param)
{
if (grid == null || param == null)
{
return;
}
grid.RowDefinitions.Clear();
var list = param.Split(',')
.Select(o => o.Trim());
foreach (var item in list)
{
var def = StringToGridLengthDefinition(item);
var rowDefinition = new RowDefinition() { Height = def.GridLength };
if (def.Max != null) { rowDefinition.MaxHeight = def.Max.Value; }
if (def.Min != null) { rowDefinition.MinHeight = def.Min.Value; }
grid.RowDefinitions.Add(rowDefinition);
}
}
// ↓GridEx内部でだけ使用する、プライベートな添付プロパティ
public static IList<NamedAreaDefinition> GetAreaDefinitions(DependencyObject obj)
{
return (IList<NamedAreaDefinition>)obj.GetValue(AreaDefinitionsProperty);
}
private static void SetAreaDefinitions(DependencyObject obj, IList<NamedAreaDefinition> value)
{
obj.SetValue(AreaDefinitionsProperty, value);
}
// Using a DependencyProperty as the backing store for AreaDefinitions. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AreaDefinitionsProperty =
DependencyProperty.RegisterAttached("AreaDefinitions", typeof(IList<NamedAreaDefinition>), typeof(GridEx), new PropertyMetadata(null));
public static string GetTemplateArea(DependencyObject obj)
{
return (string)obj.GetValue(TemplateAreaProperty);
}
public static void SetTemplateArea(DependencyObject obj, string value)
{
obj.SetValue(TemplateAreaProperty, value);
}
// Using a DependencyProperty as the backing store for TemplateArea. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TemplateAreaProperty =
DependencyProperty.RegisterAttached("TemplateArea", typeof(string), typeof(GridEx), new PropertyMetadata(null, OnTemplateAreaChanged));
private static void OnTemplateAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = d as Grid;
var param = e.NewValue as string;
if (d == null)
{
return;
}
// グリッドを一度初期化
grid.RowDefinitions.Clear();
grid.ColumnDefinitions.Clear();
// GridEx.RowDefinition/GridEx.ColumnDefinitionの設定内容で、行/列を初期化
InitializeRowDefinition(grid, GetRowDefinition(grid));
InitializeColumnDefinition(grid, GetColumnDefinition(grid));
if (param != null)
{
InitializeTemplateArea(grid, param);
}
}
private static void InitializeTemplateArea(Grid grid, string param)
{
// 行×列数のチェック
// 空行や、スペースを除去して、行×列のデータ構造に変形
var columns = param.Split(new[] { '\n', '/' })
.Select(o => o.Trim())
.Where(o => !string.IsNullOrWhiteSpace(o))
.Select(o => o.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries));
// 行×列数のチェック
var num = columns.FirstOrDefault().Count();
var isValidRowColumn = columns.All(o => o.Count() == num);
if (!isValidRowColumn)
{
// Invalid Row Columns...
throw new ArgumentException("Invalid Row/Column definition.");
}
// グリッド数を調整(不足分の行/列を足す)
var rowShortage = columns.Count() - grid.RowDefinitions.Count;
for (var i = 0; i < rowShortage; i++)
{
grid.RowDefinitions.Add(new RowDefinition());
}
var columnShortage = num - grid.ColumnDefinitions.Count;
for (var i = 0; i < columnShortage; i++)
{
grid.ColumnDefinitions.Add(new ColumnDefinition());
}
// Area定義をパース
var areaList = ParseAreaDefinition(columns);
SetAreaDefinitions(grid, areaList);
// 全体レイアウトの定義が変わったので、
// Gridの子要素のすべてのRegion設定を反映しなおす
foreach (FrameworkElement child in grid.Children)
{
UpdateItemPosition(child);
}
}
private static IList<NamedAreaDefinition> ParseAreaDefinition(IEnumerable<string[]> columns)
{
var result = new List<NamedAreaDefinition>();
// Regionが正しく連結されているかチェック
var flatten = columns.SelectMany(
(item, index) => item.Select((o, xIndex) => new { row = index, column = xIndex, name = o })
);
var groups = flatten.GroupBy(o => o.name);
foreach (var group in groups)
{
var left = group.Min(o => o.column);
var top = group.Min(o => o.row);
var right = group.Max(o => o.column);
var bottom = group.Max(o => o.row);
var isValid = true;
for (var y = top; y <= bottom; y++)
for (var x = left; x <= right; x++)
{
isValid = isValid && group.Any(o => o.column == x && o.row == y);
}
if (!isValid)
{
throw new ArgumentException($"\"{group.Key}\" is invalid area definition.");
}
result.Add(new NamedAreaDefinition(group.Key, top, left, bottom - top + 1, right - left + 1));
}
return result;
}
private static GridLengthDefinition StringToGridLengthDefinition(string source)
{
var r = new System.Text.RegularExpressions.Regex(@"(^[^\(\)]+)(?:\((.*)-(.*)\))?");
var m = r.Match(source);
var length = m.Groups[1].Value;
var min = m.Groups[2].Value;
var max = m.Groups[3].Value;
double temp;
var result = new GridLengthDefinition()
{
GridLength = StringToGridLength(length),
Min = double.TryParse(min, out temp) ? temp : (double?)null,
Max = double.TryParse(max, out temp) ? temp : (double?)null
};
return result;
}
#if WINDOWS_WPF
private static GridLength StringToGridLength(string source)
{
var glc = TypeDescriptor.GetConverter(typeof(GridLength));
return (GridLength)glc.ConvertFromString(source);
}
#elif WINDOWS_UWP
private static GridLength StringToGridLength(string source)
{
GridLength gridLength;
if (source.ToLower() == "auto")
{
gridLength = new GridLength(0.0, GridUnitType.Auto);
}
else
{
var r = new System.Text.RegularExpressions.Regex(@"([\d\.]*)(\*?)");
var m = r.Match(source);
var val = m.Groups[1].Value;
var unit = m.Groups[2].Value;
double size;
var isValid = double.TryParse(val, out size);
if (unit == "*")
{
if (string.IsNullOrEmpty(val))
{
gridLength = new GridLength(1, GridUnitType.Star);
}
else
{
if (!isValid) { throw new ArgumentException(); }
gridLength = new GridLength(size, GridUnitType.Star);
}
}
else if (string.IsNullOrEmpty(unit))
{
if (!isValid) { throw new ArgumentException(); ; }
gridLength = new GridLength(size, GridUnitType.Pixel);
}
else
{
// 変換失敗
throw new ArgumentException();
}
}
return gridLength;
}
#else
#endif
//=====================================================================
// Grid内の子要素に適用するための添付プロパティ類
//=====================================================================
public static string GetAreaName(DependencyObject obj)
{
return (string)obj.GetValue(AreaNameProperty);
}
public static void SetAreaName(DependencyObject obj, string value)
{
obj.SetValue(AreaNameProperty, value);
}
// Using a DependencyProperty as the backing store for AreaName. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AreaNameProperty =
DependencyProperty.RegisterAttached("AreaName", typeof(string), typeof(GridEx), new PropertyMetadata(null, OnAreaNameChanged));
private static void OnAreaNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = d as FrameworkElement;
if (ctrl == null)
{
return;
}
UpdateItemPosition(ctrl);
// 子要素全体のAutoFillを計算しなおす
var grid = ctrl.Parent as Grid;
var isAutoFill = GetAutoFillChildren(grid);
if (isAutoFill)
{
AutoFill(grid);
}
}
public static string GetArea(DependencyObject obj)
{
return (string)obj.GetValue(AreaProperty);
}
public static void SetArea(DependencyObject obj, string value)
{
obj.SetValue(AreaProperty, value);
}
// Using a DependencyProperty as the backing store for Area. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AreaProperty =
DependencyProperty.RegisterAttached("Area", typeof(string), typeof(GridEx), new PropertyMetadata(null, OnAreaChanged));
private static void OnAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = d as FrameworkElement;
if (d == null)
{
return;
}
UpdateItemPosition(ctrl);
// 子要素全体のAutoFillを計算しなおす
var grid = ctrl.Parent as Grid;
if (grid == null)
{
return;
}
var isAutoFill = GetAutoFillChildren(grid);
if (isAutoFill)
{
AutoFill(grid);
}
}
private static void UpdateItemPosition(FrameworkElement element)
{
// AreaName ⇒ Areaの優先順位で、グリッド位置の設定を行う
var area = GetAreaNameRegion(element) ?? GetAreaRegion(element);
if (area != null)
{
Grid.SetRow(element, area.Row);
Grid.SetColumn(element, area.Column);
Grid.SetRowSpan(element, area.RowSpan);
Grid.SetColumnSpan(element, area.ColumnSpan);
}
}
private static AreaDefinition GetAreaNameRegion(FrameworkElement element)
{
var name = GetAreaName(element);
var grid = element.Parent as Grid;
if (grid == null || name == null) { return null; }
var areaList = GetAreaDefinitions(grid);
if (areaList == null) { return null; }
var area = areaList.FirstOrDefault(o => o.Name == name);
if (area == null) { return null; }
return new AreaDefinition(area.Row, area.Column, area.RowSpan, area.ColumnSpan);
}
private static AreaDefinition GetAreaRegion(FrameworkElement element)
{
var param = GetArea(element);
if (param == null) { return null; }
var list = param.Split(',')
.Select(o => o.Trim())
.Select(o => int.Parse(o))
.ToList();
// Row, Column, RowSpan, ColumnSpan
if (list.Count() != 4) { return null; }
return new AreaDefinition(list[0], list[1], list[2], list[3]);
}
}
}
================================================
FILE: GridExtra.Shared/GridExtra.Shared.projitems
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>4914d867-f667-4151-a039-3fde665f3106</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>SourceChord.GridExtra</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)BreakPoints.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GridEx.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ResponsiveGrid.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ResponsiveGrid.Properties.cs" />
</ItemGroup>
</Project>
================================================
FILE: GridExtra.Shared/GridExtra.Shared.shproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>4914d867-f667-4151-a039-3fde665f3106</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="GridExtra.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
================================================
FILE: GridExtra.Shared/ResponsiveGrid.Properties.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if WINDOWS_WPF
using System.Windows;
using System.Windows.Controls;
#elif WINDOWS_UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
#endif
namespace SourceChord.GridExtra
{
public partial class ResponsiveGrid
{
#region ResponsiveGrid自体に設定する依存関係プロパティ
// 各種ブレークポイントの設定用プロパティ
public int MaxDivision
{
get { return (int)GetValue(MaxDivisionProperty); }
set { SetValue(MaxDivisionProperty, value); }
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for MaxDivision. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MaxDivisionProperty =
DependencyProperty.Register("MaxDivision",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(12, FrameworkPropertyMetadataOptions.AffectsMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for MaxDivision. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MaxDivisionProperty =
DependencyProperty.Register("MaxDivision", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(12, OnDependencyPropertyChanged));
private static void OnDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var element = d as FrameworkElement;
var parent = element?.Parent as ResponsiveGrid;
parent?.InvalidateMeasure();
}
#else
#endif
public BreakPoints BreakPoints
{
get { return (BreakPoints)GetValue(BreakPointsProperty); }
set { SetValue(BreakPointsProperty, value); }
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for BreakPoints. This enables animation, styling, binding, etc...
public static readonly DependencyProperty BreakPointsProperty =
DependencyProperty.Register("BreakPoints",
typeof(BreakPoints),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for BreakPoints. This enables animation, styling, binding, etc...
public static readonly DependencyProperty BreakPointsProperty =
DependencyProperty.Register("BreakPoints", typeof(BreakPoints), typeof(ResponsiveGrid), new PropertyMetadata(null, OnDependencyPropertyChanged));
#else
#endif
#if WINDOWS_WPF
public bool ShowGridLines
{
get { return (bool)GetValue(ShowGridLinesProperty); }
set { SetValue(ShowGridLinesProperty, value); }
}
// Using a DependencyProperty as the backing store for ShowGridLines. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ShowGridLinesProperty =
DependencyProperty.Register("ShowGridLines", typeof(bool), typeof(ResponsiveGrid), new PropertyMetadata(false));
#endif
#endregion
#region 各子要素のサイズを決めるための添付プロパティ
public static int GetXS(DependencyObject obj)
{
return (int)obj.GetValue(XSProperty);
}
public static void SetXS(DependencyObject obj, int value)
{
obj.SetValue(XSProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for XS. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XSProperty =
DependencyProperty.RegisterAttached("XS",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for XS. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XSProperty =
DependencyProperty.RegisterAttached("XS", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
private static void OnAttachedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var element = d as FrameworkElement;
var parent = element?.Parent as ResponsiveGrid;
parent?.InvalidateMeasure();
}
#else
#endif
public static int GetSM(DependencyObject obj)
{
return (int)obj.GetValue(SMProperty);
}
public static void SetSM(DependencyObject obj, int value)
{
obj.SetValue(SMProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for SM. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SMProperty =
DependencyProperty.RegisterAttached("SM",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for SM. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SMProperty =
DependencyProperty.RegisterAttached("SM", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetMD(DependencyObject obj)
{
return (int)obj.GetValue(MDProperty);
}
public static void SetMD(DependencyObject obj, int value)
{
obj.SetValue(MDProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for MD. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MDProperty =
DependencyProperty.RegisterAttached("MD",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for MD. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MDProperty =
DependencyProperty.RegisterAttached("MD", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetLG(DependencyObject obj)
{
return (int)obj.GetValue(LGProperty);
}
public static void SetLG(DependencyObject obj, int value)
{
obj.SetValue(LGProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for LG. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LGProperty =
DependencyProperty.RegisterAttached("LG",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for LG. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LGProperty =
DependencyProperty.RegisterAttached("LG", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
#endregion
#region Offsetプロパティ
public static int GetXS_Offset(DependencyObject obj)
{
return (int)obj.GetValue(XS_OffsetProperty);
}
public static void SetXS_Offset(DependencyObject obj, int value)
{
obj.SetValue(XS_OffsetProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for XS_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_OffsetProperty =
DependencyProperty.RegisterAttached("XS_Offset",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for XS_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_OffsetProperty =
DependencyProperty.RegisterAttached("XS_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetSM_Offset(DependencyObject obj)
{
return (int)obj.GetValue(SM_OffsetProperty);
}
public static void SetSM_Offset(DependencyObject obj, int value)
{
obj.SetValue(SM_OffsetProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for SM_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_OffsetProperty =
DependencyProperty.RegisterAttached("SM_Offset",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for SM_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_OffsetProperty =
DependencyProperty.RegisterAttached("SM_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetMD_Offset(DependencyObject obj)
{
return (int)obj.GetValue(MD_OffsetProperty);
}
public static void SetMD_Offset(DependencyObject obj, int value)
{
obj.SetValue(MD_OffsetProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for MD_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_OffsetProperty =
DependencyProperty.RegisterAttached("MD_Offset",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for MD_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_OffsetProperty =
DependencyProperty.RegisterAttached("MD_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetLG_Offset(DependencyObject obj)
{
return (int)obj.GetValue(LG_OffsetProperty);
}
public static void SetLG_Offset(DependencyObject obj, int value)
{
obj.SetValue(LG_OffsetProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for LG_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LG_OffsetProperty =
DependencyProperty.RegisterAttached("LG_Offset",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for LG_Offset. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LG_OffsetProperty =
DependencyProperty.RegisterAttached("LG_Offset", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
#endregion
#region Pushプロパティ
public static int GetXS_Push(DependencyObject obj)
{
return (int)obj.GetValue(XS_PushProperty);
}
public static void SetXS_Push(DependencyObject obj, int value)
{
obj.SetValue(XS_PushProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for XS_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_PushProperty =
DependencyProperty.RegisterAttached("XS_Push",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for XS_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_PushProperty =
DependencyProperty.RegisterAttached("XS_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetSM_Push(DependencyObject obj)
{
return (int)obj.GetValue(SM_PushProperty);
}
public static void SetSM_Push(DependencyObject obj, int value)
{
obj.SetValue(SM_PushProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for SM_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_PushProperty =
DependencyProperty.RegisterAttached("SM_Push",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for SM_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_PushProperty =
DependencyProperty.RegisterAttached("SM_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetMD_Push(DependencyObject obj)
{
return (int)obj.GetValue(MD_PushProperty);
}
public static void SetMD_Push(DependencyObject obj, int value)
{
obj.SetValue(MD_PushProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for MD_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_PushProperty =
DependencyProperty.RegisterAttached("MD_Push",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for MD_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_PushProperty =
DependencyProperty.RegisterAttached("MD_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetLG_Push(DependencyObject obj)
{
return (int)obj.GetValue(LG_PushProperty);
}
public static void SetLG_Push(DependencyObject obj, int value)
{
obj.SetValue(LG_PushProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for LG_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LG_PushProperty =
DependencyProperty.RegisterAttached("LG_Push",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for LG_Push. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LG_PushProperty =
DependencyProperty.RegisterAttached("LG_Push", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
#endregion
#region Pullプロパティ
public static int GetXS_Pull(DependencyObject obj)
{
return (int)obj.GetValue(XS_PullProperty);
}
public static void SetXS_Pull(DependencyObject obj, int value)
{
obj.SetValue(XS_PullProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for XS_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_PullProperty =
DependencyProperty.RegisterAttached("XS_Pull",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for XS_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty XS_PullProperty =
DependencyProperty.RegisterAttached("XS_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetSM_Pull(DependencyObject obj)
{
return (int)obj.GetValue(SM_PullProperty);
}
public static void SetSM_Pull(DependencyObject obj, int value)
{
obj.SetValue(SM_PullProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for SM_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_PullProperty =
DependencyProperty.RegisterAttached("SM_Pull",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for SM_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SM_PullProperty =
DependencyProperty.RegisterAttached("SM_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetMD_Pull(DependencyObject obj)
{
return (int)obj.GetValue(MD_PullProperty);
}
public static void SetMD_Pull(DependencyObject obj, int value)
{
obj.SetValue(MD_PullProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for MD_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_PullProperty =
DependencyProperty.RegisterAttached("MD_Pull",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for MD_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MD_PullProperty =
DependencyProperty.RegisterAttached("MD_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
public static int GetLG_Pull(DependencyObject obj)
{
return (int)obj.GetValue(LG_PullProperty);
}
public static void SetLG_Pull(DependencyObject obj, int value)
{
obj.SetValue(LG_PullProperty, value);
}
#if WINDOWS_WPF
// Using a DependencyProperty as the backing store for LG_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LG_PullProperty =
DependencyProperty.RegisterAttached("LG_Pull",
typeof(int),
typeof(ResponsiveGrid),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
#elif WINDOWS_UWP
// Using a DependencyProperty as the backing store for LG_Pull. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LG_PullProperty =
DependencyProperty.RegisterAttached("LG_Pull", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0, OnAttachedPropertyChanged));
#else
#endif
#endregion
#region 読み取り専用の添付プロパティ
public static int GetActualColumn(DependencyObject obj)
{
return (int)obj.GetValue(ActualColumnProperty);
}
protected static void SetActualColumn(DependencyObject obj, int value)
{
obj.SetValue(ActualColumnProperty, value);
}
// Using a DependencyProperty as the backing store for ActualColumn. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ActualColumnProperty =
DependencyProperty.RegisterAttached("ActualColumn", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0));
public static int GetActualRow(DependencyObject obj)
{
return (int)obj.GetValue(ActualRowProperty);
}
protected static void SetActualRow(DependencyObject obj, int value)
{
obj.SetValue(ActualRowProperty, value);
}
// Using a DependencyProperty as the backing store for ActualRow. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ActualRowProperty =
DependencyProperty.RegisterAttached("ActualRow", typeof(int), typeof(ResponsiveGrid), new PropertyMetadata(0));
#endregion
}
}
================================================
FILE: GridExtra.Shared/ResponsiveGrid.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if WINDOWS_WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif WINDOWS_UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
#endif
namespace SourceChord.GridExtra
{
public partial class ResponsiveGrid : Panel
{
public ResponsiveGrid()
{
this.MaxDivision = 12;
this.BreakPoints = new BreakPoints();
}
protected override Size MeasureOverride(Size availableSize)
{
var count = 0;
var currentRow = 0;
var availableWidth = double.IsPositiveInfinity(availableSize.Width) ? double.PositiveInfinity : availableSize.Width / this.MaxDivision;
var children = this.Children.OfType<UIElement>();
foreach (UIElement child in this.Children)
{
if (child != null)
{
// Collapsedの時はレイアウトしない
if (child.Visibility == Visibility.Collapsed) { continue; }
var span = this.GetSpan(child, availableSize.Width);
var offset = this.GetOffset(child, availableSize.Width);
var push = this.GetPush(child, availableSize.Width);
var pull = this.GetPull(child, availableSize.Width);
if (count + span + offset > this.MaxDivision)
{
// リセット
currentRow++;
count = 0;
}
SetActualColumn(child, count + offset + push - pull);
SetActualRow(child, currentRow);
count += (span + offset);
var size = new Size(availableWidth * span, double.PositiveInfinity);
child.Measure(size);
}
}
// 行ごとにグルーピングする
var group = this.Children.OfType<UIElement>()
.GroupBy(x => GetActualRow(x));
var totalSize = new Size();
if (group.Count() != 0)
{
totalSize.Width = group.Max(rows => rows.Sum(o => o.DesiredSize.Width));
totalSize.Height = group.Sum(rows => rows.Max(o => o.DesiredSize.Height));
}
return totalSize;
}
protected int GetSpan(UIElement element, double width)
{
var span = 0;
var getXS = new Func<UIElement, int>((o) => { var x = GetXS(o); return x != 0 ? x : this.MaxDivision; });
var getSM = new Func<UIElement, int>((o) => { var x = GetSM(o); return x != 0 ? x : getXS(o); });
var getMD = new Func<UIElement, int>((o) => { var x = GetMD(o); return x != 0 ? x : getSM(o); });
var getLG = new Func<UIElement, int>((o) => { var x = GetLG(o); return x != 0 ? x : getMD(o); });
if (width < this.BreakPoints.XS_SM)
{
span = getXS(element);
}
else if (width < this.BreakPoints.SM_MD)
{
span = getSM(element);
}
else if (width < this.BreakPoints.MD_LG)
{
span = getMD(element);
}
else
{
span = getLG(element);
}
return Math.Min(Math.Max(0, span), this.MaxDivision); ;
}
protected int GetOffset(UIElement element, double width)
{
var span = 0;
var getXS = new Func<UIElement, int>((o) => { var x = GetXS_Offset(o); return x != 0 ? x : 0; });
var getSM = new Func<UIElement, int>((o) => { var x = GetSM_Offset(o); return x != 0 ? x : getXS(o); });
var getMD = new Func<UIElement, int>((o) => { var x = GetMD_Offset(o); return x != 0 ? x : getSM(o); });
var getLG = new Func<UIElement, int>((o) => { var x = GetLG_Offset(o); return x != 0 ? x : getMD(o); });
if (width < this.BreakPoints.XS_SM)
{
span = getXS(element);
}
else if (width < this.BreakPoints.SM_MD)
{
span = getSM(element);
}
else if (width < this.BreakPoints.MD_LG)
{
span = getMD(element);
}
else
{
span = getLG(element);
}
return Math.Min(Math.Max(0, span), this.MaxDivision); ;
}
protected int GetPush(UIElement element, double width)
{
var span = 0;
var getXS = new Func<UIElement, int>((o) => { var x = GetXS_Push(o); return x != 0 ? x : 0; });
var getSM = new Func<UIElement, int>((o) => { var x = GetSM_Push(o); return x != 0 ? x : getXS(o); });
var getMD = new Func<UIElement, int>((o) => { var x = GetMD_Push(o); return x != 0 ? x : getSM(o); });
var getLG = new Func<UIElement, int>((o) => { var x = GetLG_Push(o); return x != 0 ? x : getMD(o); });
if (width < this.BreakPoints.XS_SM)
{
span = getXS(element);
}
else if (width < this.BreakPoints.SM_MD)
{
span = getSM(element);
}
else if (width < this.BreakPoints.MD_LG)
{
span = getMD(element);
}
else
{
span = getLG(element);
}
return Math.Min(Math.Max(0, span), this.MaxDivision); ;
}
protected int GetPull(UIElement element, double width)
{
var span = 0;
var getXS = new Func<UIElement, int>((o) => { var x = GetXS_Pull(o); return x != 0 ? x : 0; });
var getSM = new Func<UIElement, int>((o) => { var x = GetSM_Pull(o); return x != 0 ? x : getXS(o); });
var getMD = new Func<UIElement, int>((o) => { var x = GetMD_Pull(o); return x != 0 ? x : getSM(o); });
var getLG = new Func<UIElement, int>((o) => { var x = GetLG_Pull(o); return x != 0 ? x : getMD(o); });
if (width < this.BreakPoints.XS_SM)
{
span = getXS(element);
}
else if (width < this.BreakPoints.SM_MD)
{
span = getSM(element);
}
else if (width < this.BreakPoints.MD_LG)
{
span = getMD(element);
}
else
{
span = getLG(element);
}
return Math.Min(Math.Max(0, span), this.MaxDivision); ;
}
protected override Size ArrangeOverride(Size finalSize)
{
var columnWidth = finalSize.Width / this.MaxDivision;
// 行ごとにグルーピングする
var group = this.Children.OfType<UIElement>()
.GroupBy(x => GetActualRow(x));
double temp = 0;
foreach (var rows in group)
{
double max = 0;
var columnHeight = rows.Max(o => o.DesiredSize.Height);
foreach (var element in rows)
{
var column = GetActualColumn(element);
var row = GetActualRow(element);
var columnSpan = this.GetSpan(element, finalSize.Width);
var rect = new Rect(columnWidth * column, temp, columnWidth * columnSpan, columnHeight);
element.Arrange(rect);
max = Math.Max(element.DesiredSize.Height, max);
}
temp += max;
}
return base.ArrangeOverride(finalSize);
}
#if WINDOWS_WPF
// ShowGridLinesで表示する際に利用するペンの定義
private static readonly Pen _guidePen1
= new Pen(Brushes.Yellow, 1);
private static readonly Pen _guidePen2
= new Pen(Brushes.Blue, 1) { DashStyle = new DashStyle(new double[] { 4, 4 }, 0) };
protected override void OnRender(DrawingContext dc)
{
base.OnRender(dc);
// ShowGridLinesが有効な場合、各種エレメントを描画する前に、ガイド用のグリッドを描画する。
if (this.ShowGridLines)
{
var gridNum = this.MaxDivision;
var unit = this.ActualWidth / gridNum;
for (var i = 0; i <= gridNum; i++)
{
var x = (int)(unit * i);
dc.DrawLine(_guidePen1, new Point(x, 0), new Point(x, this.ActualHeight));
dc.DrawLine(_guidePen2, new Point(x, 0), new Point(x, this.ActualHeight));
}
}
}
#endif
}
}
================================================
FILE: GridExtra.Uwp/GridExtra.Uwp.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SourceChord.GridExtra</RootNamespace>
<AssemblyName>GridExtra.Uwp</AssemblyName>
<DefaultLanguage>ja-JP</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Build\Uwp\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Build\Uwp\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\GridExtra.Uwp.rd.xml" />
</ItemGroup>
<Import Project="..\GridExtra.Shared\GridExtra.Shared.projitems" Label="Shared" />
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: GridExtra.Uwp/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("GridExtra.Uwp")]
[assembly: AssemblyDescription("GridExtra is a custom panel library for WPF/UWP.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SourceChord")]
[assembly: AssemblyProduct("GridExtra.Uwp")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.4.0.0")]
[assembly: AssemblyFileVersion("0.4.0.0")]
[assembly: ComVisible(false)]
================================================
FILE: GridExtra.Uwp/Properties/GridExtra.Uwp.rd.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains Runtime Directives, specifications about types your application accesses
through reflection and other dynamic code patterns. Runtime Directives are used to control the
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
library does not do any reflection, then you generally do not need to edit this file. However,
if your library reflects over types, especially types passed to it or derived from its types,
then you should write Runtime Directives.
The most common use of reflection in libraries is to discover information about types passed
to the library. Runtime Directives have three ways to express requirements on types passed to
your library.
1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
Use these directives to reflect over types passed as a parameter.
2. SubTypes
Use a SubTypes directive to reflect over types derived from another type.
3. AttributeImplies
Use an AttributeImplies directive to indicate that your library needs to reflect over
types or methods decorated with an attribute.
For more information on writing Runtime Directives for libraries, please visit
http://go.microsoft.com/fwlink/?LinkID=391919
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library Name="GridExtra.Uwp">
<!-- add directives for your library here -->
</Library>
</Directives>
================================================
FILE: GridExtra.Uwp/project.json
================================================
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
================================================
FILE: GridExtra.Wpf/BreakPointsTypeConverter.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SourceChord.GridExtra
{
public class BreakPointsTypeConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
//return base.CanConvertFrom(context, sourceType);
return sourceType == typeof(string);
}
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
var text = (string)value;
var list = text.Split(',')
.Select(o => o.Trim())
.Select(o => int.Parse(o))
.ToList();
if (list.Count() != 3)
{
throw new ArgumentException($"'{value}' Invalid value. BreakPoints must contains 3 items.");
}
return new BreakPoints() { XS_SM = list[0], SM_MD = list[1], MD_LG = list[2] };
}
}
}
================================================
FILE: GridExtra.Wpf/GridExtra.Wpf.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SourceChord.GridExtra</RootNamespace>
<AssemblyName>GridExtra.Wpf</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Build\Wpf\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;WINDOWS_WPF</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Build\Wpf\Release\</OutputPath>
<DefineConstants>TRACE;WINDOWS_WPF</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="BreakPointsTypeConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="WrapPanelEx.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<Import Project="..\GridExtra.Shared\GridExtra.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: GridExtra.Wpf/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("GridExtra.Wpf")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SourceChord")]
[assembly: AssemblyProduct("GridExtra.Wpf")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
//ローカライズ可能なアプリケーションのビルドを開始するには、
//.csproj ファイルの <UICulture>CultureYouAreCodingWith</UICulture> を
//<PropertyGroup> 内部で設定します。たとえば、
//ソース ファイルで英語を使用している場合、<UICulture> を en-US に設定します。次に、
//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を
//プロジェクト ファイルの UICulture 設定と一致するよう更新します。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所
//(リソースがページ、
//またはアプリケーション リソース ディクショナリに見つからない場合に使用されます)
ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所
//(リソースがページ、
//アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます)
)]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.4.0.0")]
[assembly: AssemblyFileVersion("0.4.0.0")]
================================================
FILE: GridExtra.Wpf/Properties/Resources.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------
namespace SourceChord.GridExtra.Properties {
using System;
/// <summary>
/// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
/// </summary>
// このクラスは StronglyTypedResourceBuilder クラスが ResGen
// または Visual Studio のようなツールを使用して自動生成されました。
// メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
// ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SourceChord.GridExtra.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
/// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
================================================
FILE: GridExtra.Wpf/Properties/Resources.resx
================================================
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
================================================
FILE: GridExtra.Wpf/Properties/Settings.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------
namespace SourceChord.GridExtra.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
================================================
FILE: GridExtra.Wpf/Properties/Settings.settings
================================================
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
================================================
FILE: GridExtra.Wpf/WrapPanelEx.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace SourceChord.GridExtra
{
public static class WrapPanelEx
{
public static Size GetOriginalSize(DependencyObject obj)
{
return (Size)obj.GetValue(OriginalSizeProperty);
}
private static void SetOriginalSize(DependencyObject obj, Size value)
{
obj.SetValue(OriginalSizeProperty, value);
}
// Using a DependencyProperty as the backing store for OriginalSize. This enables animation, styling, binding, etc...
public static readonly DependencyProperty OriginalSizeProperty =
DependencyProperty.RegisterAttached("OriginalSize", typeof(Size), typeof(WrapPanelEx), new PropertyMetadata(Size.Empty));
public static bool GetAdaptiveLayout(DependencyObject obj)
{
return (bool)obj.GetValue(AdaptiveLayoutProperty);
}
public static void SetAdaptiveLayout(DependencyObject obj, bool value)
{
obj.SetValue(AdaptiveLayoutProperty, value);
}
// Using a DependencyProperty as the backing store for AdaptiveLayout. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AdaptiveLayoutProperty =
DependencyProperty.RegisterAttached("AdaptiveLayout", typeof(bool), typeof(WrapPanelEx), new PropertyMetadata(false, OnAdaptiveLayoutChanged));
private static void OnAdaptiveLayoutChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var panel = d as WrapPanel;
var isEnabled = (bool)e.NewValue;
if (panel == null) { return; }
if (isEnabled)
{
SetOriginalSize(panel, new Size(panel.ItemWidth, panel.ItemHeight));
var layoutUpdateCallback = CreateLayoutUpdateHandler(panel);
panel.LayoutUpdated += layoutUpdateCallback;
SetLayoutUpdatedCallback(panel, layoutUpdateCallback);
}
else
{
var originalSize = GetOriginalSize(panel);
panel.ItemWidth = originalSize.Width;
panel.ItemHeight = originalSize.Height;
panel.ClearValue(OriginalSizeProperty);
// イベントの解除
var callback = GetLayoutUpdatedCallback(panel);
panel.LayoutUpdated -= callback;
}
}
private static EventHandler CreateLayoutUpdateHandler(WrapPanel panel)
{
var layoutUpdateCallback = new EventHandler((sender, args) =>
{
if (panel == null) return;
var orientaion = panel.Orientation;
var originalSize = GetOriginalSize(panel);
if (orientaion == Orientation.Horizontal)
{
if (double.IsNaN(originalSize.Width)) return;
var count = Math.Floor(panel.ActualWidth / originalSize.Width);
var size = panel.ActualWidth / count;
panel.ItemWidth = size;
}
else
{
if (double.IsNaN(originalSize.Width)) return;
var count = Math.Floor(panel.ActualHeight / originalSize.Height);
var size = panel.ActualHeight / count;
panel.ItemHeight = size;
}
});
return layoutUpdateCallback;
}
public static EventHandler GetLayoutUpdatedCallback(DependencyObject obj)
{
return (EventHandler)obj.GetValue(LayoutUpdatedCallbackProperty);
}
private static void SetLayoutUpdatedCallback(DependencyObject obj, EventHandler value)
{
obj.SetValue(LayoutUpdatedCallbackProperty, value);
}
// Using a DependencyProperty as the backing store for LayoutUpdatedCallback. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LayoutUpdatedCallbackProperty =
DependencyProperty.RegisterAttached("LayoutUpdatedCallback", typeof(EventHandler), typeof(WrapPanelEx), new PropertyMetadata(null));
}
}
================================================
FILE: GridExtra.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridExtra.Wpf", "GridExtra.Wpf\GridExtra.Wpf.csproj", "{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GridExtra.Uwp", "GridExtra.Uwp\GridExtra.Uwp.csproj", "{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "GridExtra.Shared", "GridExtra.Shared\GridExtra.Shared.shproj", "{4914D867-F667-4151-A039-3FDE665F3106}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{611249A1-CDE6-4AAD-B532-73007C552C77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicSample.Wpf", "Sample\BasicSample.Wpf\BasicSample.Wpf.csproj", "{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicSample.Uwp", "Sample\BasicSample.Uwp\BasicSample.Uwp.csproj", "{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget", "Nuget", "{E1C85495-293B-4198-845C-6D7068A1961E}"
ProjectSection(SolutionItems) = preProject
Nuget\GridExtra.nuspec = Nuget\GridExtra.nuspec
Nuget\pack.bat = Nuget\pack.bat
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
GridExtra.Shared\GridExtra.Shared.projitems*{4914d867-f667-4151-a039-3fde665f3106}*SharedItemsImports = 13
GridExtra.Shared\GridExtra.Shared.projitems*{631c583b-5e88-4abd-9926-c18e4addf6c6}*SharedItemsImports = 4
GridExtra.Shared\GridExtra.Shared.projitems*{fe7a5887-17bc-48e9-b601-815a2fdbf2a0}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|ARM.ActiveCfg = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|ARM.Build.0 = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|x64.ActiveCfg = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|x64.Build.0 = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|x86.ActiveCfg = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Debug|x86.Build.0 = Debug|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|Any CPU.Build.0 = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|ARM.ActiveCfg = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|ARM.Build.0 = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|x64.ActiveCfg = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|x64.Build.0 = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|x86.ActiveCfg = Release|Any CPU
{631C583B-5E88-4ABD-9926-C18E4ADDF6C6}.Release|x86.Build.0 = Release|Any CPU
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|ARM.ActiveCfg = Debug|ARM
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|ARM.Build.0 = Debug|ARM
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|x64.ActiveCfg = Debug|x64
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|x64.Build.0 = Debug|x64
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|x86.ActiveCfg = Debug|x86
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Debug|x86.Build.0 = Debug|x86
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|Any CPU.Build.0 = Release|Any CPU
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|ARM.ActiveCfg = Release|ARM
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|ARM.Build.0 = Release|ARM
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|x64.ActiveCfg = Release|x64
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|x64.Build.0 = Release|x64
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|x86.ActiveCfg = Release|x86
{FE7A5887-17BC-48E9-B601-815A2FDBF2A0}.Release|x86.Build.0 = Release|x86
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|ARM.Build.0 = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|x64.ActiveCfg = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|x64.Build.0 = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|x86.ActiveCfg = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Debug|x86.Build.0 = Debug|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|Any CPU.Build.0 = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|ARM.ActiveCfg = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|ARM.Build.0 = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|x64.ActiveCfg = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|x64.Build.0 = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|x86.ActiveCfg = Release|Any CPU
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}.Release|x86.Build.0 = Release|Any CPU
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|Any CPU.ActiveCfg = Debug|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|ARM.ActiveCfg = Debug|ARM
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|ARM.Build.0 = Debug|ARM
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|ARM.Deploy.0 = Debug|ARM
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|x64.ActiveCfg = Debug|x64
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|x64.Build.0 = Debug|x64
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|x64.Deploy.0 = Debug|x64
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|x86.ActiveCfg = Debug|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|x86.Build.0 = Debug|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Debug|x86.Deploy.0 = Debug|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|Any CPU.ActiveCfg = Release|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|ARM.ActiveCfg = Release|ARM
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|ARM.Build.0 = Release|ARM
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|ARM.Deploy.0 = Release|ARM
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|x64.ActiveCfg = Release|x64
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|x64.Build.0 = Release|x64
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|x64.Deploy.0 = Release|x64
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|x86.ActiveCfg = Release|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|x86.Build.0 = Release|x86
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B} = {611249A1-CDE6-4AAD-B532-73007C552C77}
{416D9AA6-F3E7-4338-B9A3-E060060DAF0C} = {611249A1-CDE6-4AAD-B532-73007C552C77}
EndGlobalSection
EndGlobal
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2016 minami_SC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Nuget/GridExtra.nuspec
================================================
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>GridExtra</id>
<version>0.4.0</version>
<title>GridExtra</title>
<authors>SourceChord</authors>
<owners>SourceChord</owners>
<licenseUrl>https://github.com/sourcechord/GridExtra/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/sourcechord/GridExtra</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>GridExtra is a custom panel library for WPF/UWP.</description>
<copyright>Copyright 2016</copyright>
<tags>XAML WPF UWP Panel Library</tags>
</metadata>
<files>
<file src="..\Build\Wpf\Release\GridExtra.Wpf.dll" target="lib\net45\GridExtra.Wpf.dll" />
<file src="..\Build\Uwp\Release\GridExtra.Uwp.dll" target="lib\uap10.0\GridExtra.Uwp.dll" />
</files>
</package>
================================================
FILE: Nuget/pack.bat
================================================
nuget pack GridExtra.nuspec
pause
================================================
FILE: README.md
================================================
# GridExtra
GridExtra is a custom panel library for WPF/UWP.
* ResponsiveGrid
* Custom Panel class that provides bootstrap like grid system.
* Grid system
* switch layout with window width.
* XS(<768px), SM(<992px), MD(<1200px), LG(1200px<=)
* 12 columns across the page.(customizable with MaxDivision property)
* GridEx
* Helper class that defines usefull attached properties for Grid panel.
* WrapPanelEx
* Helper class that provide adaptive layout for WrapPanel.
## install
*Nuget Package*
```
Install-Package GridExtra
```
https://www.nuget.org/packages/GridExtra/
### Preparation
Add xmlns to xaml code.
#### For WPF
```xml
xmlns:ge="clr-namespace:SourceChord.GridExtra;assembly=GridExtra.Wpf"
```
#### For UWP
```xml
xmlns:ge="using:SourceChord.GridExtra"
```
## Usage
### ResponsiveGrid
ResponsiveGrid provides the grid layout system that is similar to Bootstrap framework.

#### Example
```xml
<Grid>
<Grid.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="LightGray" />
<Setter Property="Height" Value="60" />
</Style>
</Grid.Resources>
<rg:ResponsiveGrid>
<Border ge:ResponsiveGrid.XS="12" ge:ResponsiveGrid.SM="3" />
<Border ge:ResponsiveGrid.XS="12" ge:ResponsiveGrid.SM="6" />
<Border ge:ResponsiveGrid.XS="12" ge:ResponsiveGrid.SM="3" />
</rg:ResponsiveGrid>
</Grid>
```
*extra small device(~768px)*

*small device(~992px)*

#### Properties
##### Dependency Properties
|Property Name|Type|Description|
|-----|-----|-----|
|MaxDivision|int|Gets or sets a value that determines grid divisions.|
|BreakPoints|BreakPoints class||
|ShowGridLines|int|Gets or sets a value that indicates whether grid column's lines are visible within this ResponsiveGrid. |
##### Attached Properties
|Property Name|Type|Description|
|-----|-----|-----|
|XS<br/>SM<br/>MD<br/>LG<br/>|int|Gets or sets a value that determines grid columns for XS(extra small), SM(small), MD(medium), LG(large) devices.|
|XS_Offset<br/>SM_Offset<br/>MD_Offset<br/>LG_Offset<br/>|int|Gets or sets a value that determines grid columns offset for XS(extra small), SM(small), MD(medium), LG(large) devices.|
|XS_Push<br/>SM_Push<br/>MD_Push<br/>LG_Push<br/>|int|Gets or sets a value that moves columns to right from the original position.|
|XS_Pull<br/>SM_Pull<br/>MD_Pull<br/>LG_Pull<br/>|int|Gets or sets a value that moves columns to left from the original position.|
##### Compared to bootstrap
|bootstrap|ResponsiveGrid|
|-----|-----|
|col-xs<br/>col-sm<br/>col-md<br/>col-lg<br/>|XS<br/>SM<br/>MD<br/>LG<br/>|
|col-xs-offset<br/>col-sm-offset<br/>col-md-offset<br/>col-lg-offset<br/>|XS_Offset<br/>SM_Offset<br/>MD_Offset<br/>LG_Offset<br/>|
|col-xs-push<br/>col-sm-push<br/>col-md-push<br/>col-lg-push<br/>|XS_Push<br/>SM_Push<br/>MD_Push<br/>LG_Push<br/>|
|col-xs-pull<br/>col-sm-pull<br/>col-md-pull<br/>col-lg-pull<br/>|XS_Pull<br/>SM_Pull<br/>MD_Pull<br/>LG_Pull<br/>|
|visibility-xs, visibility-sm,…<br />hidden-xs, hidden-sm,...|(T.B.D.)|
#### attention
ResponsiveGrid is not suitable for ItemsPanel, because it isn't implemented VirtualizingPanel class.
If you use ResponsiveGrid in ListBox as ItemsPanel.
Your ListBox become to not virtualize items of ListBox.
### GridEx
GridEx is Helper class for defining Grid properties.

#### Example1 (Row/Column Definition)
```xml
<Grid ge:GridEx.RowDefinition="*, *, *, *"
ge:GridEx.ColumnDefinition="50, 75, *, 2*"
ShowGridLines="True">
<Button Grid.Row="1"
Grid.Column="2"
Margin="5"
Content="Button" />
</Grid>
```

##### Row/Column Definition with Min/Max size
```xml
<Grid ge:GridEx.RowDefinition="*, *, *, *"
ge:GridEx.ColumnDefinition="50, *(50-200), 2*(80-), 2*(-300)"
ShowGridLines="True">
<Button Grid.Row="1"
Grid.Column="2"
Margin="5"
Content="Button" />
</Grid>
```
`ge:GridEx.ColumnDefinition="50, *(50-200), 2*(80-), 2*(-300)"` is similar to below definition.
```xml
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="*" MinWidth="50" MaxWidth="200"/>
<ColumnDefinition Width="2*" MinWidth="80"/>
<ColumnDefinition Width="2*" MaxWidth="300"/>
</Grid.ColumnDefinitions>
```
#### Example2 (Area Definition)
`Area` property provides the way of defineing Row/Column/RowSpan/ColumnSpan.
```xml
<Grid ge:GridEx.RowDefinition="*, *, *, *"
ge:GridEx.ColumnDefinition="*, *, *, *"
ShowGridLines="True">
<Button Margin="5"
ge:GridEx.Area="0, 0, 1, 2"
Content="GridEx.Area="0, 0, 1, 2"" />
<Button Margin="5"
ge:GridEx.Area="2, 1, 2, 3"
Content="GridEx.Area="2, 1, 2, 3"" />
</Grid>
```

#### Example3 (Named Template Area)
`TemplateArea` provides named grid areas, like CSS Grid Layout Module Level 1.
`TemplateArea` property makes row/column definition. And, define region's name.
Children of Grid can be placed with region's name, that is defined by `TemplateArea` property.
```xml
<Grid ge:GridEx.TemplateArea="
Header Header Header
Menu Content SubMenu
Footer Footer Footer
"
ShowGridLines="True">
<Button Margin="5"
ge:GridEx.AreaName="Header"
Content="Header" />
<Button Margin="5"
ge:GridEx.AreaName="Menu"
Content="Menu" />
<Button Margin="5"
ge:GridEx.AreaName="Content"
Content="Content" />
<Button Margin="5"
ge:GridEx.AreaName="SubMenu"
Content="SubMenu" />
<Button Margin="5"
ge:GridEx.AreaName="Footer"
Content="Footer" />
</Grid>
```

Row devision is defined by line feed or `/`.
* line feed
* `\n`(.cs)
* ` `(xaml)
* `/`
```xml
<Grid ge:GridEx.TemplateArea="
Header Header Header/
Menu Content SubMenu/
Footer Footer Footer/
">
```
#### Example4 (Named Template Area, working with RowDefinition/ColumnDefintion)
```xml
<Grid ge:GridEx.RowDefinition="50, *, 30"
ge:GridEx.ColumnDefinition="*, 2*, 100"
ge:GridEx.TemplateArea="
Header Header Header/
Menu Content SubMenu/
Footer Footer Footer/
"
ShowGridLines="True">
<Button Margin="5"
ge:GridEx.AreaName="Header"
Content="Header" />
<Button Margin="5"
ge:GridEx.AreaName="Menu"
Content="Menu" />
<Button Margin="5"
ge:GridEx.AreaName="Content"
Content="Content" />
<Button Margin="5"
ge:GridEx.AreaName="SubMenu"
Content="SubMenu" />
<Button Margin="5"
ge:GridEx.AreaName="Footer"
Content="Footer" />
</Grid>
```

##### Attached Properties(for Grid)
|Property Name|Type|Description|
|-----|-----|-----|
|RowDefinition|string|Sets a value that determines row definition of Grid.|
|ColumnDefinition|string|Sets a value that determines column definition of Grid.|
|TemplateArea|string|Sets a definition of grid devision and area names. |
##### Attached Properties(for Grid children)
|Property Name|Type|Description|
|-----|-----|-----|
|Area|string|Sets a value that determines Row, Column, RowSpan, ColumnSpan properties.|
|AreaName|string|Sets a name of regions for item's belong.(use with `TemplateArea` property)|
#### Example5 (Auto fill children)

##### Attached Properties(for Grid)
|Property Name|Type|Description|
|-----|-----|-----|
|AutoFillChildren|string|Gets or sets a value that indicates whether the Grid arranges its children to each cell.|
|AutoFillOrientation|string|Sets a value that determines auto fill orientation.|
##### Attached Properties(for Grid children)
|Property Name|Type|Description|
|-----|-----|-----|
|AutoFillSpan|string|Sets a value that determines cell span value that is used during AutoFill process.|
```xml
<Grid ge:GridEx.ColumnDefinition="*, *"
ge:GridEx.RowDefinition="Auto, Auto, Auto"
ge:GridEx.AutoFillChildren="True"
ShowGridLines="True">
<TextBlock Text="Name:" />
<TextBox VerticalAlignment="Top" Margin="5"/>
<TextBlock Text="Age:" />
<TextBox VerticalAlignment="Top" Margin="5"/>
<Button ge:GridEx.Area="2, 1, 1, 1"
Margin="5" Width="60"
HorizontalAlignment="Right"
Content="OK" />
</Grid>
```

##### AutoFillChildren with Hidden/Collapsed items
```xml
<Grid ge:GridEx.ColumnDefinition="*, *, *"
ge:GridEx.RowDefinition="*, *"
ge:GridEx.AutoFillChildren="True">
<Button Content="1" Visibility="Hidden"/>
<Button Content="2" />
<Button Content="3" />
<Button Content="4" />
<Button Content="5" Visibility="Collapsed" />
<Button Content="6" />
</Grid>
```

##### AutoFillChildren with pinned items
```xml
<Grid ge:GridEx.ColumnDefinition="*, *, *"
ge:GridEx.RowDefinition="*, *"
ge:GridEx.AutoFillChildren="True">
<Button Content="1" />
<Button Content="2" />
<Button Content="3" />
<Button Content="4" />
<Button Content="Fixed Item" ge:GridEx.Area="0,1,1,1"/>
</Grid>
```

### WrapPanelEx **(WPF Only)**
WrapPanelEx is Helper class that provide adaptive layout for WrapPanel.

#### Example1
WrapPanelEx.AdaptiveLayout property makes WrapPanel into UWP Community Toolkit's [AdaptiveGridView](https://docs.microsoft.com/en-us/windows/uwpcommunitytoolkit/controls/AdaptiveGridView) like layout.
```xml
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<WrapPanel ItemWidth="200" ItemHeight="70"
Orientation="Horizontal"
ge:WrapPanelEx.AdaptiveLayout="{Binding IsChecked, ElementName=chkIsAdaptive}">
<Button />
<Button />
<Button />
<Button />
<Button />
<Button />
<Button />
</WrapPanel>
<CheckBox x:Name="chkIsAdaptive"
Grid.Row="1" Margin="5"
Content="WrapPanelEx.AdaptiveLayout"/>
</Grid>
```
## Lisence
[MIT](LICENSE)
================================================
FILE: Sample/BasicSample.Uwp/App.xaml
================================================
<Application
x:Class="BasicSample.Uwp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BasicSample.Uwp"
RequestedTheme="Light">
</Application>
================================================
FILE: Sample/BasicSample.Uwp/App.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace BasicSample.Uwp
{
/// <summary>
/// 既定の Application クラスを補完するアプリケーション固有の動作を提供します。
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// 単一アプリケーション オブジェクトを初期化します。これは、実行される作成したコードの
///最初の行であるため、main() または WinMain() と論理的に等価です。
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// アプリケーションがエンド ユーザーによって正常に起動されたときに呼び出されます。他のエントリ ポイントは、
/// アプリケーションが特定のファイルを開くために起動されたときなどに使用されます。
/// </summary>
/// <param name="e">起動の要求とプロセスの詳細を表示します。</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// ウィンドウに既にコンテンツが表示されている場合は、アプリケーションの初期化を繰り返さずに、
// ウィンドウがアクティブであることだけを確認してください
if (rootFrame == null)
{
// ナビゲーション コンテキストとして動作するフレームを作成し、最初のページに移動します
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: 以前中断したアプリケーションから状態を読み込みます
}
// フレームを現在のウィンドウに配置します
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// ナビゲーション スタックが復元されない場合は、最初のページに移動します。
// このとき、必要な情報をナビゲーション パラメーターとして渡して、新しいページを
//構成します
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// 現在のウィンドウがアクティブであることを確認します
Window.Current.Activate();
}
}
/// <summary>
/// 特定のページへの移動が失敗したときに呼び出されます
/// </summary>
/// <param name="sender">移動に失敗したフレーム</param>
/// <param name="e">ナビゲーション エラーの詳細</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// アプリケーションの実行が中断されたときに呼び出されます。
/// アプリケーションが終了されるか、メモリの内容がそのままで再開されるかに
/// かかわらず、アプリケーションの状態が保存されます。
/// </summary>
/// <param name="sender">中断要求の送信元。</param>
/// <param name="e">中断要求の詳細。</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: アプリケーションの状態を保存してバックグラウンドの動作があれば停止します
deferral.Complete();
}
}
}
================================================
FILE: Sample/BasicSample.Uwp/BasicSample.Uwp.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{416D9AA6-F3E7-4338-B9A3-E060060DAF0C}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BasicSample.Uwp</RootNamespace>
<AssemblyName>BasicSample.Uwp</AssemblyName>
<DefaultLanguage>ja-JP</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>BasicSample.Uwp_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="BasicSample.Uwp_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\GridExtra.Uwp\GridExtra.Uwp.csproj">
<Project>{fe7a5887-17bc-48e9-b601-815a2fdbf2a0}</Project>
<Name>GridExtra.Uwp</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Sample/BasicSample.Uwp/MainPage.xaml
================================================
<Page
x:Class="BasicSample.Uwp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BasicSample.Uwp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ge="using:SourceChord.GridExtra"
mc:Ignorable="d">
<Grid x:Name="grid"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
ge:GridEx.ColumnDefinition="*, *, *, *"
ge:GridEx.TemplateArea="
Header Header Header
Menu Content SubMenu
Footer Footer Footer
">
<Grid.Resources>
<Style TargetType="Button">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
</Style>
</Grid.Resources>
<Button Content="Button" Margin="5" ge:GridEx.AreaName="Header" />
<Button Content="Menu" Margin="5" ge:GridEx.AreaName="Menu"/>
<Button Content="Content" Margin="5" ge:GridEx.Area="1,1,2,2" Click="Button_Click"/>
</Grid>
</Page>
================================================
FILE: Sample/BasicSample.Uwp/MainPage.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// 空白ページのアイテム テンプレートについては、http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 を参照してください
namespace BasicSample.Uwp
{
/// <summary>
/// それ自体で使用できる空白ページまたはフレーム内に移動できる空白ページ。
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var temp = @"
Header Header SubMenu
Menu Content SubMenu
Footer Footer Footer
";
SourceChord.GridExtra.GridEx.SetTemplateArea(grid, temp);
}
}
}
================================================
FILE: Sample/BasicSample.Uwp/Package.appxmanifest
================================================
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="6b093e0d-5afb-44a5-bf33-5ae8c9995de8"
Publisher="CN=minami"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="6b093e0d-5afb-44a5-bf33-5ae8c9995de8" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>BasicSample.Uwp</DisplayName>
<PublisherDisplayName>minami</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="BasicSample.Uwp.App">
<uap:VisualElements
DisplayName="BasicSample.Uwp"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="BasicSample.Uwp"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
================================================
FILE: Sample/BasicSample.Uwp/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BasicSample.Uwp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BasicSample.Uwp")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
================================================
FILE: Sample/BasicSample.Uwp/Properties/Default.rd.xml
================================================
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All"/>
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>
================================================
FILE: Sample/BasicSample.Uwp/project.json
================================================
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
================================================
FILE: Sample/BasicSample.Wpf/App.config
================================================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
================================================
FILE: Sample/BasicSample.Wpf/App.xaml
================================================
<Application x:Class="BasicSample.Wpf.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BasicSample.Wpf"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
================================================
FILE: Sample/BasicSample.Wpf/App.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace BasicSample.Wpf
{
/// <summary>
/// App.xaml の相互作用ロジック
/// </summary>
public partial class App : Application
{
}
}
================================================
FILE: Sample/BasicSample.Wpf/BasicSample.Wpf.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E180DF3E-1A9F-482E-A7E2-FD7FBB27514B}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BasicSample.Wpf</RootNamespace>
<AssemblyName>BasicSample.Wpf</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\GridExtra.Wpf\GridExtra.Wpf.csproj">
<Project>{631c583b-5e88-4abd-9926-c18e4addf6c6}</Project>
<Name>GridExtra.Wpf</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Sample/BasicSample.Wpf/MainWindow.xaml
================================================
<Window x:Class="BasicSample.Wpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BasicSample.Wpf"
xmlns:ge="clr-namespace:SourceChord.GridExtra;assembly=GridExtra.Wpf"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid x:Name="grid"
ge:GridEx.TemplateArea="
Header Header Header/
Menu Content SubMenu/
Footer Footer Footer/
">
<Button Content="Header" Margin="5" ge:GridEx.AreaName="Header" />
<Button Content="Menu" Margin="5" ge:GridEx.AreaName="Menu" />
<Button Content="SubMenu" Margin="5" ge:GridEx.AreaName="SubMenu" />
<Button Content="Content" Margin="5" ge:GridEx.AreaName="Content" Click="Button_Click" />
<Button Content="Footer" Margin="5" ge:GridEx.AreaName="Footer" />
</Grid>
</Window>
================================================
FILE: Sample/BasicSample.Wpf/MainWindow.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BasicSample.Wpf
{
/// <summary>
/// MainWindow.xaml の相互作用ロジック
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var temp = @"
Header Header
Menu SubMenu
Content Content
Footer Footer
";
SourceChord.GridExtra.GridEx.SetTemplateArea(grid, temp);
}
}
}
================================================
FILE: Sample/BasicSample.Wpf/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("BasicSample.Wpf")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BasicSample.Wpf")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
//ローカライズ可能なアプリケーションのビルドを開始するには、
//.csproj ファイルの <UICulture>CultureYouAreCodingWith</UICulture> を
//<PropertyGroup> 内部で設定します。たとえば、
//ソース ファイルで英語を使用している場合、<UICulture> を en-US に設定します。次に、
//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を
//プロジェクト ファイルの UICulture 設定と一致するよう更新します。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所
//(リソースがページ、
//またはアプリケーション リソース ディクショナリに見つからない場合に使用されます)
ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所
//(リソースがページ、
//アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます)
)]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
================================================
FILE: Sample/BasicSample.Wpf/Properties/Resources.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします
// </auto-generated>
//------------------------------------------------------------------------------
namespace BasicSample.Wpf.Properties
{
/// <summary>
/// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
/// </summary>
// このクラスは StronglyTypedResourceBuilder クラスによって ResGen
// または Visual Studio のようなツールを使用して自動生成されました。
// メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
// ResGen を実行し直すか、または VS プロジェクトをリビルドします。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// このクラスで使用されるキャッシュされた ResourceManager インスタンスを返します。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BasicSample.Wpf.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
/// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
================================================
FILE: Sample/BasicSample.Wpf/Properties/Resources.resx
================================================
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
================================================
FILE: Sample/BasicSample.Wpf/Properties/Settings.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BasicSample.Wpf.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
================================================
FILE: Sample/BasicSample.Wpf/Properties/Settings.settings
================================================
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
gitextract_enuf11w3/
├── .gitignore
├── GridExtra.Shared/
│ ├── BreakPoints.cs
│ ├── GridEx.cs
│ ├── GridExtra.Shared.projitems
│ ├── GridExtra.Shared.shproj
│ ├── ResponsiveGrid.Properties.cs
│ └── ResponsiveGrid.cs
├── GridExtra.Uwp/
│ ├── GridExtra.Uwp.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── GridExtra.Uwp.rd.xml
│ └── project.json
├── GridExtra.Wpf/
│ ├── BreakPointsTypeConverter.cs
│ ├── GridExtra.Wpf.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── WrapPanelEx.cs
├── GridExtra.sln
├── LICENSE
├── Nuget/
│ ├── GridExtra.nuspec
│ └── pack.bat
├── README.md
└── Sample/
├── BasicSample.Uwp/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── BasicSample.Uwp.csproj
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── project.json
└── BasicSample.Wpf/
├── App.config
├── App.xaml
├── App.xaml.cs
├── BasicSample.Wpf.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
└── Properties/
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
SYMBOL INDEX (123 symbols across 14 files)
FILE: GridExtra.Shared/BreakPoints.cs
class BreakPoints (line 19) | #if WINDOWS_WPF
method BreakPoints (line 52) | public BreakPoints()
FILE: GridExtra.Shared/GridEx.cs
class AreaDefinition (line 28) | public class AreaDefinition
method AreaDefinition (line 35) | public AreaDefinition(int row, int column, int rowSpan, int columnSpan)
class NamedAreaDefinition (line 44) | public class NamedAreaDefinition : AreaDefinition
method NamedAreaDefinition (line 48) | public NamedAreaDefinition(string name, int row, int column, int rowSp...
type GridLengthDefinition (line 55) | struct GridLengthDefinition
class GridEx (line 62) | public static class GridEx
method GetAutoFillOrientation (line 64) | public static Orientation GetAutoFillOrientation(DependencyObject obj)
method SetAutoFillOrientation (line 68) | public static void SetAutoFillOrientation(DependencyObject obj, Orient...
method GetAutoFillChildren (line 77) | public static bool GetAutoFillChildren(DependencyObject obj)
method SetAutoFillChildren (line 81) | public static void SetAutoFillChildren(DependencyObject obj, bool value)
method OnAutoFillChildrenChanged (line 89) | private static void OnAutoFillChildrenChanged(DependencyObject d, Depe...
method CreateLayoutUpdateHandler (line 117) | private static LayoutUpdateEventHandler CreateLayoutUpdateHandler(Grid...
method GetLayoutUpdatedCallback (line 147) | public static LayoutUpdateEventHandler GetLayoutUpdatedCallback(Depend...
method SetLayoutUpdatedCallback (line 151) | private static void SetLayoutUpdatedCallback(DependencyObject obj, Lay...
method AutoFill (line 160) | private static void AutoFill(Grid grid)
method ClearAutoFill (line 246) | private static void ClearAutoFill(Grid grid)
method GetColumnDefinition (line 260) | public static string GetColumnDefinition(DependencyObject obj)
method SetColumnDefinition (line 264) | public static void SetColumnDefinition(DependencyObject obj, string va...
method OnColumnDefinitionChanged (line 272) | private static void OnColumnDefinitionChanged(DependencyObject d, Depe...
method InitializeColumnDefinition (line 286) | private static void InitializeColumnDefinition(Grid grid, string param)
method GetRowDefinition (line 308) | public static string GetRowDefinition(DependencyObject obj)
method SetRowDefinition (line 312) | public static void SetRowDefinition(DependencyObject obj, string value)
method OnRowDefinitionChanged (line 320) | private static void OnRowDefinitionChanged(DependencyObject d, Depende...
method InitializeRowDefinition (line 334) | private static void InitializeRowDefinition(Grid grid, string param)
method GetAreaDefinitions (line 357) | public static IList<NamedAreaDefinition> GetAreaDefinitions(Dependency...
method SetAreaDefinitions (line 361) | private static void SetAreaDefinitions(DependencyObject obj, IList<Nam...
method GetTemplateArea (line 371) | public static string GetTemplateArea(DependencyObject obj)
method SetTemplateArea (line 375) | public static void SetTemplateArea(DependencyObject obj, string value)
method OnTemplateAreaChanged (line 383) | private static void OnTemplateAreaChanged(DependencyObject d, Dependen...
method InitializeTemplateArea (line 407) | private static void InitializeTemplateArea(Grid grid, string param)
method ParseAreaDefinition (line 451) | private static IList<NamedAreaDefinition> ParseAreaDefinition(IEnumera...
method StringToGridLengthDefinition (line 486) | private static GridLengthDefinition StringToGridLengthDefinition(strin...
method StringToGridLength (line 507) | private static GridLength StringToGridLength(string source)
method StringToGridLength (line 513) | private static GridLength StringToGridLength(string source)
method GetAreaName (line 564) | public static string GetAreaName(DependencyObject obj)
method SetAreaName (line 568) | public static void SetAreaName(DependencyObject obj, string value)
method OnAreaNameChanged (line 576) | private static void OnAreaNameChanged(DependencyObject d, DependencyPr...
method GetArea (line 596) | public static string GetArea(DependencyObject obj)
method SetArea (line 600) | public static void SetArea(DependencyObject obj, string value)
method OnAreaChanged (line 608) | private static void OnAreaChanged(DependencyObject d, DependencyProper...
method UpdateItemPosition (line 634) | private static void UpdateItemPosition(FrameworkElement element)
method GetAreaNameRegion (line 648) | private static AreaDefinition GetAreaNameRegion(FrameworkElement element)
method GetAreaRegion (line 662) | private static AreaDefinition GetAreaRegion(FrameworkElement element)
FILE: GridExtra.Shared/ResponsiveGrid.Properties.cs
class ResponsiveGrid (line 19) | public partial class ResponsiveGrid
method OnDependencyPropertyChanged (line 40) | private static void OnDependencyPropertyChanged(DependencyObject d, De...
method GetXS (line 85) | public static int GetXS(DependencyObject obj)
method SetXS (line 89) | public static void SetXS(DependencyObject obj, int value)
method OnAttachedPropertyChanged (line 105) | private static void OnAttachedPropertyChanged(DependencyObject d, Depe...
method GetSM (line 114) | public static int GetSM(DependencyObject obj)
method SetSM (line 118) | public static void SetSM(DependencyObject obj, int value)
method GetMD (line 136) | public static int GetMD(DependencyObject obj)
method SetMD (line 140) | public static void SetMD(DependencyObject obj, int value)
method GetLG (line 158) | public static int GetLG(DependencyObject obj)
method SetLG (line 162) | public static void SetLG(DependencyObject obj, int value)
method GetXS_Offset (line 183) | public static int GetXS_Offset(DependencyObject obj)
method SetXS_Offset (line 187) | public static void SetXS_Offset(DependencyObject obj, int value)
method GetSM_Offset (line 205) | public static int GetSM_Offset(DependencyObject obj)
method SetSM_Offset (line 209) | public static void SetSM_Offset(DependencyObject obj, int value)
method GetMD_Offset (line 227) | public static int GetMD_Offset(DependencyObject obj)
method SetMD_Offset (line 231) | public static void SetMD_Offset(DependencyObject obj, int value)
method GetLG_Offset (line 249) | public static int GetLG_Offset(DependencyObject obj)
method SetLG_Offset (line 253) | public static void SetLG_Offset(DependencyObject obj, int value)
method GetXS_Push (line 275) | public static int GetXS_Push(DependencyObject obj)
method SetXS_Push (line 279) | public static void SetXS_Push(DependencyObject obj, int value)
method GetSM_Push (line 297) | public static int GetSM_Push(DependencyObject obj)
method SetSM_Push (line 301) | public static void SetSM_Push(DependencyObject obj, int value)
method GetMD_Push (line 319) | public static int GetMD_Push(DependencyObject obj)
method SetMD_Push (line 323) | public static void SetMD_Push(DependencyObject obj, int value)
method GetLG_Push (line 341) | public static int GetLG_Push(DependencyObject obj)
method SetLG_Push (line 345) | public static void SetLG_Push(DependencyObject obj, int value)
method GetXS_Pull (line 367) | public static int GetXS_Pull(DependencyObject obj)
method SetXS_Pull (line 371) | public static void SetXS_Pull(DependencyObject obj, int value)
method GetSM_Pull (line 389) | public static int GetSM_Pull(DependencyObject obj)
method SetSM_Pull (line 393) | public static void SetSM_Pull(DependencyObject obj, int value)
method GetMD_Pull (line 411) | public static int GetMD_Pull(DependencyObject obj)
method SetMD_Pull (line 415) | public static void SetMD_Pull(DependencyObject obj, int value)
method GetLG_Pull (line 433) | public static int GetLG_Pull(DependencyObject obj)
method SetLG_Pull (line 437) | public static void SetLG_Pull(DependencyObject obj, int value)
method GetActualColumn (line 459) | public static int GetActualColumn(DependencyObject obj)
method SetActualColumn (line 463) | protected static void SetActualColumn(DependencyObject obj, int value)
method GetActualRow (line 471) | public static int GetActualRow(DependencyObject obj)
method SetActualRow (line 475) | protected static void SetActualRow(DependencyObject obj, int value)
FILE: GridExtra.Shared/ResponsiveGrid.cs
class ResponsiveGrid (line 20) | public partial class ResponsiveGrid : Panel
method ResponsiveGrid (line 22) | public ResponsiveGrid()
method MeasureOverride (line 28) | protected override Size MeasureOverride(Size availableSize)
method GetSpan (line 80) | protected int GetSpan(UIElement element, double width)
method GetOffset (line 109) | protected int GetOffset(UIElement element, double width)
method GetPush (line 138) | protected int GetPush(UIElement element, double width)
method GetPull (line 167) | protected int GetPull(UIElement element, double width)
method ArrangeOverride (line 196) | protected override Size ArrangeOverride(Size finalSize)
method OnRender (line 235) | protected override void OnRender(DrawingContext dc)
FILE: GridExtra.Wpf/BreakPointsTypeConverter.cs
class BreakPointsTypeConverter (line 11) | public class BreakPointsTypeConverter : TypeConverter
method CanConvertFrom (line 13) | public override bool CanConvertFrom(ITypeDescriptorContext context, Ty...
method ConvertFrom (line 19) | public override object ConvertFrom(ITypeDescriptorContext context, Cul...
FILE: GridExtra.Wpf/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: GridExtra.Wpf/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
FILE: GridExtra.Wpf/WrapPanelEx.cs
class WrapPanelEx (line 11) | public static class WrapPanelEx
method GetOriginalSize (line 14) | public static Size GetOriginalSize(DependencyObject obj)
method SetOriginalSize (line 19) | private static void SetOriginalSize(DependencyObject obj, Size value)
method GetAdaptiveLayout (line 29) | public static bool GetAdaptiveLayout(DependencyObject obj)
method SetAdaptiveLayout (line 34) | public static void SetAdaptiveLayout(DependencyObject obj, bool value)
method OnAdaptiveLayoutChanged (line 43) | private static void OnAdaptiveLayoutChanged(DependencyObject d, Depend...
method CreateLayoutUpdateHandler (line 70) | private static EventHandler CreateLayoutUpdateHandler(WrapPanel panel)
method GetLayoutUpdatedCallback (line 101) | public static EventHandler GetLayoutUpdatedCallback(DependencyObject obj)
method SetLayoutUpdatedCallback (line 105) | private static void SetLayoutUpdatedCallback(DependencyObject obj, Eve...
FILE: Sample/BasicSample.Uwp/App.xaml.cs
class App (line 23) | sealed partial class App : Application
method App (line 29) | public App()
method OnLaunched (line 40) | protected override void OnLaunched(LaunchActivatedEventArgs e)
method OnNavigationFailed (line 87) | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
method OnSuspending (line 99) | private void OnSuspending(object sender, SuspendingEventArgs e)
FILE: Sample/BasicSample.Uwp/MainPage.xaml.cs
class MainPage (line 23) | public sealed partial class MainPage : Page
method MainPage (line 25) | public MainPage()
method Button_Click (line 30) | private void Button_Click(object sender, RoutedEventArgs e)
FILE: Sample/BasicSample.Wpf/App.xaml.cs
class App (line 14) | public partial class App : Application
FILE: Sample/BasicSample.Wpf/MainWindow.xaml.cs
class MainWindow (line 21) | public partial class MainWindow : Window
method MainWindow (line 23) | public MainWindow()
method Button_Click (line 28) | private void Button_Click(object sender, RoutedEventArgs e)
FILE: Sample/BasicSample.Wpf/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 32) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: Sample/BasicSample.Wpf/Properties/Settings.Designer.cs
class Settings (line 15) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
Condensed preview — 44 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (166K chars).
[
{
"path": ".gitignore",
"chars": 4195,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
},
{
"path": "GridExtra.Shared/BreakPoints.cs",
"chars": 1912,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n#if WINDOWS_WPF\nusing System.Win"
},
{
"path": "GridExtra.Shared/GridEx.cs",
"chars": 24487,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Text;\n\n#if"
},
{
"path": "GridExtra.Shared/GridExtra.Shared.projitems",
"chars": 802,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n <Propert"
},
{
"path": "GridExtra.Shared/GridExtra.Shared.shproj",
"chars": 1065,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "GridExtra.Shared/ResponsiveGrid.Properties.cs",
"chars": 23992,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n#if WINDOWS_WPF\nusing System.Win"
},
{
"path": "GridExtra.Shared/ResponsiveGrid.cs",
"chars": 8811,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n#if WINDOWS_WPF\nusing System.Win"
},
{
"path": "GridExtra.Uwp/GridExtra.Uwp.csproj",
"chars": 5949,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "GridExtra.Uwp/Properties/AssemblyInfo.cs",
"chars": 1102,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "GridExtra.Uwp/Properties/GridExtra.Uwp.rd.xml",
"chars": 1543,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n This file contains Runtime Directives, specifications about types your a"
},
{
"path": "GridExtra.Uwp/project.json",
"chars": 285,
"preview": "{\n \"dependencies\": {\n \"Microsoft.NETCore.UniversalWindowsPlatform\": \"5.1.0\"\n },\n \"frameworks\": {\n \"uap10.0\": {"
},
{
"path": "GridExtra.Wpf/BreakPointsTypeConverter.cs",
"chars": 1122,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.L"
},
{
"path": "GridExtra.Wpf/GridExtra.Wpf.csproj",
"chars": 3891,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "GridExtra.Wpf/Properties/AssemblyInfo.cs",
"chars": 1828,
"preview": "using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropSer"
},
{
"path": "GridExtra.Wpf/Properties/Resources.Designer.cs",
"chars": 2615,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// このコードはツールによ"
},
{
"path": "GridExtra.Wpf/Properties/Resources.resx",
"chars": 5494,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "GridExtra.Wpf/Properties/Settings.Designer.cs",
"chars": 1021,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// このコードはツールによ"
},
{
"path": "GridExtra.Wpf/Properties/Settings.settings",
"chars": 193,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n <Profiles>\n "
},
{
"path": "GridExtra.Wpf/WrapPanelEx.cs",
"chars": 4371,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusi"
},
{
"path": "GridExtra.sln",
"chars": 7734,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.25420.1\nMini"
},
{
"path": "LICENSE",
"chars": 1066,
"preview": "MIT License\n\nCopyright (c) 2016 minami_SC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
},
{
"path": "Nuget/GridExtra.nuspec",
"chars": 964,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n "
},
{
"path": "Nuget/pack.bat",
"chars": 34,
"preview": "nuget pack GridExtra.nuspec\npause\n"
},
{
"path": "README.md",
"chars": 11473,
"preview": "# GridExtra\nGridExtra is a custom panel library for WPF/UWP.\n\n\n* ResponsiveGrid\n * Custom Panel class that provides b"
},
{
"path": "Sample/BasicSample.Uwp/App.xaml",
"chars": 261,
"preview": "<Application\n x:Class=\"BasicSample.Uwp.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n "
},
{
"path": "Sample/BasicSample.Uwp/App.xaml.cs",
"chars": 3452,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropService"
},
{
"path": "Sample/BasicSample.Uwp/BasicSample.Uwp.csproj",
"chars": 6657,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Sample/BasicSample.Uwp/MainPage.xaml",
"chars": 1251,
"preview": "<Page\n x:Class=\"BasicSample.Uwp.MainPage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n "
},
{
"path": "Sample/BasicSample.Uwp/MainPage.xaml.cs",
"chars": 1061,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropService"
},
{
"path": "Sample/BasicSample.Uwp/Package.appxmanifest",
"chars": 1579,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<Package\n xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows"
},
{
"path": "Sample/BasicSample.Uwp/Properties/AssemblyInfo.cs",
"chars": 1047,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Sample/BasicSample.Uwp/Properties/Default.rd.xml",
"chars": 1240,
"preview": "<!--\n This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most\n develope"
},
{
"path": "Sample/BasicSample.Uwp/project.json",
"chars": 285,
"preview": "{\n \"dependencies\": {\n \"Microsoft.NETCore.UniversalWindowsPlatform\": \"5.1.0\"\n },\n \"frameworks\": {\n \"uap10.0\": {"
},
{
"path": "Sample/BasicSample.Wpf/App.config",
"chars": 182,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n <startup> \n <supportedRuntime version=\"v4.0\" sku=\".N"
},
{
"path": "Sample/BasicSample.Wpf/App.xaml",
"chars": 373,
"preview": "<Application x:Class=\"BasicSample.Wpf.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentatio"
},
{
"path": "Sample/BasicSample.Wpf/App.xaml.cs",
"chars": 317,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Data;\nusing System.Linq;\nusing"
},
{
"path": "Sample/BasicSample.Wpf/BasicSample.Wpf.csproj",
"chars": 4663,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Sample/BasicSample.Wpf/MainWindow.xaml",
"chars": 1136,
"preview": "<Window x:Class=\"BasicSample.Wpf.MainWindow\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n"
},
{
"path": "Sample/BasicSample.Wpf/MainWindow.xaml.cs",
"chars": 923,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusi"
},
{
"path": "Sample/BasicSample.Wpf/Properties/AssemblyInfo.cs",
"chars": 1854,
"preview": "using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropSer"
},
{
"path": "Sample/BasicSample.Wpf/Properties/Resources.Designer.cs",
"chars": 2596,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// このコードはツールによ"
},
{
"path": "Sample/BasicSample.Wpf/Properties/Resources.resx",
"chars": 5494,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Sample/BasicSample.Wpf/Properties/Settings.Designer.cs",
"chars": 1070,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "Sample/BasicSample.Wpf/Properties/Settings.settings",
"chars": 193,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n <Profiles>\n "
}
]
About this extraction
This page contains the full source code of the sourcechord/GridExtra GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 44 files (148.0 KB), approximately 38.1k tokens, and a symbol index with 123 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.