This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<string> countries = {"Argentina", "Australia", "Belgium", "Chile", "Denmark", "Fiji", "Germany", "Greece"}; | |
var newList = from c in countries | |
where c.Contains("e") | |
select c.ToUpper(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x => /*some code goes here*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some data to work with | |
List<string> countries = {"Argentina", "Australia", "Belgium", "Chile", "Denmark", "Fiji", "Germany", "Greece"}; | |
// Using a foreach loop | |
var newList = new List<string>(); | |
foreach(var c in countries) | |
{ | |
if (c.Contains("e")) | |
{ | |
newList.Add(c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some data to work with | |
List<string> countries = {"Argentina", "Australia", "Belgium", "Chile", "Denmark", "Fiji", "Germany", "Greece"}; | |
// Using a foreach loop | |
var filteredList = new List<string>(); | |
foreach(var c in countries) | |
{ | |
if (c.Contains("e")) | |
{ | |
filteredList.Add(c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListView> | |
<ListView.ItemContainerStyle> | |
<Style TargetType="ListViewItem"> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate> | |
<ContentPresenter/> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition/> | |
<ColumnDefinition/> | |
<ColumnDefinition/> | |
</Grid.ColumnDefinitions> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override Size MeasureOverride(Size availableSize) | |
{ | |
// Set it to use whole available width | |
var finalSize = new Size { Width = availableSize.Width }; | |
var columnWidth = availableSize.Width / MaximumColumns; | |
var rowHeight = 0d; | |
var rowChildCount = 0; | |
foreach (var child in Children) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override Size ArrangeOverride(Size finalSize) | |
{ | |
var columnWidth = finalSize.Width / MaximumColumns; | |
var posY = 0d; | |
var rowHeight = 0d; | |
var rowChildCount = 0; | |
foreach (var child in Children) | |
{ | |
if (rowChildCount >= MaximumColumns) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Windows.Foundation; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
namespace KodeFisk | |
{ | |
public class AutoUniformWidthWrapPanel : Panel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override Size MeasureOverride(Size availableSize) | |
{ | |
var finalSize = new Size { Width = availableSize.Width }; | |
var rowHeight = 0d; | |
var posX = 0d; | |
foreach (var child in Children) | |
{ | |
child.Measure(availableSize); |
OlderNewer