Added ObservableTableAndCollectionViewSource sample

This commit is contained in:
Laurent Bugnion 2016-02-11 17:21:28 +01:00
Родитель e1358e670f
Коммит b7495083f3
37 изменённых файлов: 5757 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,40 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObservableTableAndCollectionViewSource", "ObservableTableAndCollectionViewSource\ObservableTableAndCollectionViewSource.csproj", "{3A7F1D68-7793-417D-BBD2-7262FB875234}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|iPhone = Ad-Hoc|iPhone
Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
AppStore|iPhone = AppStore|iPhone
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.AppStore|iPhone.Build.0 = AppStore|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Debug|iPhone.ActiveCfg = Debug|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Debug|iPhone.Build.0 = Debug|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Release|iPhone.ActiveCfg = Release|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Release|iPhone.Build.0 = Release|iPhone
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{3A7F1D68-7793-417D-BBD2-7262FB875234}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,63 @@
using Foundation;
using GalaSoft.MvvmLight.Ioc;
using GalaSoft.MvvmLight.Messaging;
using GalaSoft.MvvmLight.Threading;
using GalaSoft.MvvmLight.Views;
using Microsoft.Practices.ServiceLocation;
using ObservableTableAndCollectionViewSource.ViewModel;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
public override UIWindow Window
{
get;
set;
}
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
// MVVM Light's DispatcherHelper for cross-thread handling.
DispatcherHelper.Initialize(app);
// Illustrates how to use the Messenger by receiving a message
// and sending a message back.
Messenger.Default.Register<NotificationMessageAction<string>>(
this,
HandleNotificationMessage);
// Configure and register the MVVM Light NavigationService
var nav = new NavigationService();
SimpleIoc.Default.Register<INavigationService>(() => nav);
nav.Initialize((UINavigationController)Window.RootViewController);
nav.Configure(ViewModelLocator.SecondPageKey, ViewModelLocator.SecondPageKey);
nav.Configure(ViewModelLocator.ThirdPageKey, ViewModelLocator.ThirdPageKey);
// Register the MVVM Light DialogService
SimpleIoc.Default.Register<IDialogService, DialogService>();
return true;
}
private void HandleNotificationMessage(NotificationMessageAction<string> message)
{
// Execute a callback to send a reply to the sender.
message.Execute("Success! (from AppDelegate.cs)");
}
}
}

Просмотреть файл

@ -0,0 +1,126 @@
using System.Collections.Generic;
using Foundation;
using GalaSoft.MvvmLight.Helpers;
using ObservableTableAndCollectionViewSource.Layout;
using ObservableTableAndCollectionViewSource.Model;
using ObservableTableAndCollectionViewSource.ViewModel;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
partial class CollectionViewController : UICollectionViewController
{
private const string CellId = "AnimalCell";
private static readonly NSString HeaderId = new NSString("Header");
private readonly List<Binding> _bindings = new List<Binding>();
private HeaderForCollectionView _headerView;
private ObservableCollectionViewSource<DataItem, TestCollectionViewCell> _source;
private MainViewModel Vm
{
get
{
return Application.Locator.Main;
}
}
public CollectionViewController(UICollectionViewLayout layout)
: base(layout)
{
}
public UICollectionReusableView GetViewForSupplementaryElement(NSString elementKind, NSIndexPath indexPath)
{
if (_headerView == null)
{
_headerView =
(HeaderForCollectionView)
CollectionView.DequeueReusableSupplementaryView(elementKind, HeaderId, indexPath);
_bindings.Add(
this.SetBinding(
() => _source.SelectedItem.Title,
() => _headerView.SelectedItemLabel.Text,
fallbackValue: "Nothing yet"));
}
return _headerView;
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
CollectionView.RegisterClassForSupplementaryView(
// Needed if you want to provide a header or footer
typeof (HeaderForCollectionView),
UICollectionElementKindSection.Header,
HeaderId);
CollectionView.BackgroundColor = UIColor.White;
_source = Vm.Items.GetCollectionViewSource<DataItem, TestCollectionViewCell>(
BindCell,
GetViewForSupplementaryElement,
// Optional, for header and footer
CellId,
// Reuse Cell ID
() => new CollectionViewSourceEx());
// Last argument is optional, provides a way to define your own derived class and extend it.
CollectionView.Source = _source;
var addButton = new UIBarButtonItem
{
Title = "Add"
};
addButton.SetCommand(Vm.AddCommand);
var delButton = new UIBarButtonItem
{
Title = "Del"
};
var selectedItemBinding = this.SetBinding(() => _source.SelectedItem);
_bindings.Add(selectedItemBinding);
delButton.SetCommand(Vm.DeleteCommand, selectedItemBinding);
NavigationItem.RightBarButtonItems = new[]
{
delButton,
addButton,
};
}
private void BindCell(TestCollectionViewCell collectionViewCell, DataItem item, NSIndexPath path)
{
collectionViewCell.Text = item.Title;
}
}
public class CollectionViewSourceEx : ObservableCollectionViewSource<DataItem, TestCollectionViewCell>
{
public override UICollectionViewCell GetCell(UICollectionView view, NSIndexPath indexPath)
{
var cell = base.GetCell(view, indexPath);
cell.ContentView.BackgroundColor = UIColor.White;
return cell;
}
public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
{
SelectedItem = null;
var cell = collectionView.CellForItem(indexPath);
cell.ContentView.BackgroundColor = UIColor.White;
}
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
{
var item = GetItem(indexPath);
SelectedItem = item;
var cell = collectionView.CellForItem(indexPath);
cell.ContentView.BackgroundColor = UIColor.Green;
}
}
}

Просмотреть файл

@ -0,0 +1,21 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
[Register ("CollectionViewController")]
partial class CollectionViewController
{
void ReleaseDesignerOutlets ()
{
}
}
}

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

Просмотреть файл

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>ObservableTableAndCollectionViewSource</string>
<key>CFBundleIdentifier</key>
<string>com.your-company.ObservableTableAndCollectionViewSource.iOS</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>7.0</string>
<key>UIMainStoryboardFile</key>
<string>Main_iPhone</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,86 @@
using System;
using CoreGraphics;
using Foundation;
using UIKit;
namespace ObservableTableAndCollectionViewSource.Layout
{
public class CircleLayout : UICollectionViewLayout
{
private const float ItemSize = 70.0f;
private static readonly NSString MyDecorationViewId = new NSString("MyDecorationView");
private int _cellCount = 20;
private CGPoint _center;
private float _radius;
public override CGSize CollectionViewContentSize
{
get
{
return CollectionView.Frame.Size;
}
}
public CircleLayout()
{
RegisterClassForDecorationView(typeof (MyDecorationView), MyDecorationViewId);
}
public override UICollectionViewLayoutAttributes[] LayoutAttributesForElementsInRect(CGRect rect)
{
var attributes = new UICollectionViewLayoutAttributes[_cellCount + 1];
for (int i = 0; i < _cellCount; i++)
{
NSIndexPath indexPath = NSIndexPath.FromItemSection(i, 0);
attributes[i] = LayoutAttributesForItem(indexPath);
}
var decorationAttribs = UICollectionViewLayoutAttributes.CreateForDecorationView(
MyDecorationViewId,
NSIndexPath.FromItemSection(0, 0));
decorationAttribs.Size = CollectionView.Frame.Size;
decorationAttribs.Center = CollectionView.Center;
decorationAttribs.ZIndex = -1;
attributes[_cellCount] = decorationAttribs;
return attributes;
}
public override UICollectionViewLayoutAttributes LayoutAttributesForItem(NSIndexPath path)
{
UICollectionViewLayoutAttributes attributes = UICollectionViewLayoutAttributes.CreateForCell(path);
attributes.Size = new CGSize(ItemSize, ItemSize);
attributes.Center = new CGPoint(
_center.X + _radius * (float)Math.Cos(2 * path.Row * Math.PI / _cellCount),
_center.Y + _radius * (float)Math.Sin(2 * path.Row * Math.PI / _cellCount));
return attributes;
}
public override void PrepareLayout()
{
base.PrepareLayout();
CGSize size = CollectionView.Frame.Size;
_cellCount = (int)CollectionView.NumberOfItemsInSection(0);
_center = new CGPoint(size.Width / 2.0f, size.Height / 2.0f);
_radius = (float)Math.Min(size.Width, size.Height) / 2.5f;
}
public override bool ShouldInvalidateLayoutForBoundsChange(CGRect newBounds)
{
return true;
}
}
public class MyDecorationView : UICollectionReusableView
{
[Export("initWithFrame:")]
public MyDecorationView(CGRect frame)
: base(frame)
{
BackgroundColor = UIColor.Red;
}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
using CoreGraphics;
using Foundation;
using UIKit;
namespace ObservableTableAndCollectionViewSource.Layout
{
public class GridLayout : UICollectionViewFlowLayout
{
public GridLayout ()
{
HeaderReferenceSize = new CGSize(100, 50);
}
public override bool ShouldInvalidateLayoutForBoundsChange (CGRect newBounds)
{
return true;
}
public override UICollectionViewLayoutAttributes LayoutAttributesForItem (NSIndexPath path)
{
return base.LayoutAttributesForItem (path);
}
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using CoreGraphics;
using Foundation;
using UIKit;
namespace ObservableTableAndCollectionViewSource.Layout
{
public class HeaderForCollectionView : UICollectionReusableView
{
public UILabel SelectedItemLabel
{
get;
private set;
}
[Export("initWithFrame:")]
public HeaderForCollectionView(CGRect frame)
: base(frame)
{
BackgroundColor = UIColor.Red;
var titleLabel = new UILabel
{
Frame = new CGRect(10, -10, 300, 50),
Text = "Selected item:"
};
SelectedItemLabel = new UILabel
{
Frame = new CGRect(10, 10, 300, 50),
};
AddSubview(titleLabel);
AddSubview(SelectedItemLabel);
}
}
}

Просмотреть файл

@ -0,0 +1,33 @@
using CoreGraphics;
using UIKit;
namespace ObservableTableAndCollectionViewSource.Layout
{
public class HeaderForTableView : UICollectionReusableView
{
public UILabel SelectedItemLabel
{
get;
private set;
}
public HeaderForTableView()
{
BackgroundColor = UIColor.Red;
var titleLabel = new UILabel
{
Frame = new CGRect(10, -10, 300, 50),
Text = "Selected item:"
};
SelectedItemLabel = new UILabel
{
Frame = new CGRect(10, 10, 300, 50),
};
AddSubview(titleLabel);
AddSubview(SelectedItemLabel);
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
using CoreGraphics;
using Foundation;
using UIKit;
namespace ObservableTableAndCollectionViewSource.Layout
{
public class TestCollectionViewCell : UICollectionViewCell
{
private readonly UILabel _label;
public string Text
{
set
{
_label.Text = value;
}
}
[Export("initWithFrame:")]
public TestCollectionViewCell(CGRect frame)
: base(frame)
{
BackgroundView = new UIView
{
BackgroundColor = UIColor.Orange
};
SelectedBackgroundView = new UIView
{
BackgroundColor = UIColor.Green
};
ContentView.Layer.BorderColor = UIColor.LightGray.CGColor;
ContentView.Layer.BorderWidth = 2.0f;
ContentView.BackgroundColor = UIColor.White;
_label = new UILabel
{
Frame = new CGRect(5, 0, 50, 50),
BackgroundColor = UIColor.FromRGBA(0, 0, 0, 0)
};
ContentView.AddSubview(_label);
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
using System;
using CoreGraphics;
using Foundation;
using UIKit;
namespace ObservableTableAndCollectionViewSource.Layout
{
public class TestTableViewCell : UITableViewCell
{
private readonly UILabel _label;
public string Text
{
set
{
_label.Text = value;
}
}
public TestTableViewCell(IntPtr handle)
: base(handle)
{
BackgroundView = new UIView
{
BackgroundColor = UIColor.Orange
};
SelectedBackgroundView = new UIView
{
BackgroundColor = UIColor.Green
};
ContentView.Layer.BorderColor = UIColor.LightGray.CGColor;
ContentView.Layer.BorderWidth = 2.0f;
ContentView.BackgroundColor = UIColor.White;
_label = new UILabel
{
Frame = new CGRect(5, 0, 50, 50),
BackgroundColor = UIColor.FromRGBA(0, 0, 0, 0)
};
ContentView.AddSubview(_label);
}
}
}

Просмотреть файл

@ -0,0 +1,26 @@
using ObservableTableAndCollectionViewSource.ViewModel;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
public class Application
{
private static ViewModelLocator _locator;
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
public static ViewModelLocator Locator
{
get
{
return _locator ?? (_locator = new ViewModelLocator());
}
}
}
}

Просмотреть файл

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using Foundation;
using GalaSoft.MvvmLight.Helpers;
using GalaSoft.MvvmLight.Views;
using Microsoft.Practices.ServiceLocation;
using ObservableTableAndCollectionViewSource.Layout;
using ObservableTableAndCollectionViewSource.Model;
using ObservableTableAndCollectionViewSource.ViewModel;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
partial class MainViewController : UIViewController
{
// Keep track of bindings to avoid premature garbage collection
private readonly List<Binding> _bindings = new List<Binding>();
private MainViewModel Vm
{
get
{
return Application.Locator.Main;
}
}
public NavigationService Nav
{
get
{
return (NavigationService)ServiceLocator.Current.GetInstance<INavigationService>();
}
}
public MainViewController(IntPtr handle) : base(handle)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
ControllerInCodeButton.TouchUpInside += (s, e) =>
{
var c = Vm.Items.GetController(CreateCell, BindCell);
Nav.NavigationController.PushViewController(c, true);
};
TableSourceWithCreateCellButton.TouchUpInside += (s, e) =>
{
Nav.NavigateTo(ViewModelLocator.SecondPageKey, true);
};
TableSourceWithReuseIdButton.TouchUpInside += (s, e) =>
{
Nav.NavigateTo(ViewModelLocator.SecondPageKey, false);
};
CollectionViewGridButton.TouchUpInside += (s, e) =>
{
var controller = new CollectionViewController(new GridLayout());
Nav.NavigationController.PushViewController(controller, true);
};
CollectionViewCircleButton.TouchUpInside += (s, e) =>
{
var controller = new CollectionViewController(new CircleLayout());
Nav.NavigationController.PushViewController(controller, true);
};
}
private void BindCell(UITableViewCell cell, DataItem item, NSIndexPath path)
{
cell.TextLabel.Text = item.Title;
}
private UITableViewCell CreateCell(NSString reuseId)
{
return new UITableViewCell(UITableViewCellStyle.Default, reuseId);
}
}
}

Просмотреть файл

@ -0,0 +1,61 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
[Register ("MainViewController")]
partial class MainViewController
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIButton CollectionViewCircleButton { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIButton CollectionViewGridButton { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIButton ControllerInCodeButton { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIButton TableSourceWithCreateCellButton { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIButton TableSourceWithReuseIdButton { get; set; }
void ReleaseDesignerOutlets ()
{
if (CollectionViewCircleButton != null) {
CollectionViewCircleButton.Dispose ();
CollectionViewCircleButton = null;
}
if (CollectionViewGridButton != null) {
CollectionViewGridButton.Dispose ();
CollectionViewGridButton = null;
}
if (ControllerInCodeButton != null) {
ControllerInCodeButton.Dispose ();
ControllerInCodeButton = null;
}
if (TableSourceWithCreateCellButton != null) {
TableSourceWithCreateCellButton.Dispose ();
TableSourceWithCreateCellButton = null;
}
if (TableSourceWithReuseIdButton != null) {
TableSourceWithReuseIdButton.Dispose ();
TableSourceWithReuseIdButton = null;
}
}
}
}

Просмотреть файл

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="8">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733.0"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="7">
<objects>
<navigationController definesPresentationContext="YES" id="8" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="11">
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<rect key="frame" x="0.0" y="20" width="320" height="44"/>
</navigationBar>
<connections>
<segue destination="10" kind="relationship" relationship="rootViewController" id="9"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="12" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-39" y="75"/>
</scene>
<scene sceneID="13">
<objects>
<viewController id="10" sceneMemberID="viewController" customClass="MainViewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="5"/>
<viewControllerLayoutGuide type="bottom" id="6"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="15">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="164" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="10" y="84" width="300" height="30"/>
<state key="normal" title="Controller in code">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<constraints>
<constraint id="172" firstItem="164" firstAttribute="height" constant="30"/>
</constraints>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="165" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="10" y="134" width="300" height="30"/>
<state key="normal" title="TableSource with CreateCell">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<constraints>
<constraint id="176" firstItem="165" firstAttribute="height" constant="30"/>
</constraints>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="166" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="10" y="184" width="300" height="30"/>
<state key="normal" title="TableSource with Reuse ID">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<constraints>
<constraint id="180" firstItem="166" firstAttribute="height" constant="30"/>
</constraints>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="167" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="10" y="234" width="300" height="30"/>
<state key="normal" title="CollectionView (Grid)">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<constraints>
<constraint id="184" firstItem="167" firstAttribute="height" constant="30"/>
</constraints>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="168" translatesAutoresizingMaskIntoConstraints="NO">
<rect key="frame" x="10" y="284" width="300" height="30"/>
<state key="normal" title="CollectionView (Circle)">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<constraints>
<constraint id="188" firstItem="168" firstAttribute="height" constant="30"/>
</constraints>
</button>
</subviews>
<constraints>
<constraint id="169" firstItem="164" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="20"/>
<constraint id="170" firstItem="164" firstAttribute="leading" secondItem="15" secondAttribute="leading" constant="10"/>
<constraint id="171" firstItem="15" firstAttribute="trailing" secondItem="164" secondAttribute="trailing" constant="10"/>
<constraint id="173" firstItem="165" firstAttribute="top" secondItem="164" secondAttribute="bottom" constant="20"/>
<constraint id="174" firstItem="165" firstAttribute="leading" secondItem="15" secondAttribute="leading" constant="10"/>
<constraint id="175" firstItem="15" firstAttribute="trailing" secondItem="165" secondAttribute="trailing" constant="10"/>
<constraint id="177" firstItem="166" firstAttribute="top" secondItem="165" secondAttribute="bottom" constant="20"/>
<constraint id="178" firstItem="166" firstAttribute="leading" secondItem="15" secondAttribute="leading" constant="10"/>
<constraint id="179" firstItem="15" firstAttribute="trailing" secondItem="166" secondAttribute="trailing" constant="10"/>
<constraint id="181" firstItem="167" firstAttribute="top" secondItem="166" secondAttribute="bottom" constant="20"/>
<constraint id="182" firstItem="167" firstAttribute="leading" secondItem="15" secondAttribute="leading" constant="10"/>
<constraint id="183" firstItem="15" firstAttribute="trailing" secondItem="167" secondAttribute="trailing" constant="10"/>
<constraint id="185" firstItem="168" firstAttribute="top" secondItem="167" secondAttribute="bottom" constant="20"/>
<constraint id="186" firstItem="168" firstAttribute="leading" secondItem="15" secondAttribute="leading" constant="10"/>
<constraint id="187" firstItem="15" firstAttribute="trailing" secondItem="168" secondAttribute="trailing" constant="10"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="Observable TVS and CVS" id="14"/>
<connections>
<outlet property="ControllerInCodeButton" destination="164" id="name-outlet-164"/>
<outlet property="TableSourceWithCreateCellButton" destination="165" id="name-outlet-165"/>
<outlet property="TableSourceWithReuseIdButton" destination="166" id="name-outlet-166"/>
<outlet property="CollectionViewGridButton" destination="167" id="name-outlet-167"/>
<outlet property="CollectionViewCircleButton" destination="168" id="name-outlet-168"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="16" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="393" y="79"/>
</scene>
<scene sceneID="146">
<objects>
<tableViewController id="147" sceneMemberID="viewController" customClass="UITableViewTableSourceController" storyboardIdentifier="UITableViewTableSourceController" useStoryboardIdentifierAsRestorationIdentifier="YES">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="148">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="151" rowHeight="44">
<rect key="frame" x="0.0" y="22" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="151" id="152">
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="147" id="149"/>
<outlet property="delegate" destination="147" id="150"/>
</connections>
</tableView>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="153" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="791" y="84"/>
</scene>
<scene sceneID="155">
<objects>
<collectionViewController autoresizesArchivedViewToFullSize="NO" id="156" sceneMemberID="viewController" customClass="CollectionViewController" storyboardIdentifier="CollectionViewController" useStoryboardIdentifierAsRestorationIdentifier="YES">
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" minimumZoomScale="0.0" maximumZoomScale="0.0" dataMode="prototypes" id="157">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="161">
<size key="itemSize" width="50" height="50"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="160">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</collectionViewCell>
</cells>
<connections>
<outlet property="dataSource" destination="156" id="158"/>
<outlet property="delegate" destination="156" id="159"/>
</connections>
</collectionView>
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="162" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1189" y="89"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<resources>
<image name="Default-568h.png" width="320" height="568"/>
</resources>
</document>

Просмотреть файл

@ -0,0 +1,16 @@
namespace ObservableTableAndCollectionViewSource.Model
{
public class DataItem
{
public DataItem(string title)
{
Title = title;
}
public string Title
{
get;
private set;
}
}
}

Просмотреть файл

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectGuid>{3A7F1D68-7793-417D-BBD2-7262FB875234}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>ObservableTableAndCollectionViewSource</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>ObservableTableAndCollectionViewSource</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<MtouchArch>i386, x86_64</MtouchArch>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<BuildIpa>True</BuildIpa>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Compile Include="CollectionViewController.cs" />
<Compile Include="CollectionViewController.designer.cs">
<DependentUpon>CollectionViewController.cs</DependentUpon>
</Compile>
<Compile Include="Layout\HeaderForTableView.cs" />
<Compile Include="Layout\HeaderForCollectionView.cs" />
<Compile Include="Layout\TestTableViewCell.cs" />
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="Layout\CircleLayout.cs" />
<Compile Include="Layout\GridLayout.cs" />
<Compile Include="Layout\TestCollectionViewCell.cs" />
<Compile Include="UITableViewTableSourceController.cs" />
<Compile Include="UITableViewTableSourceController.designer.cs">
<DependentUpon>UITableViewTableSourceController.cs</DependentUpon>
</Compile>
<Compile Include="ViewModel\MainViewModel.cs" />
<Compile Include="ViewModel\ViewModelLocator.cs" />
<None Include="Info.plist" />
<Compile Include="MainViewController.cs" />
<Compile Include="MainViewController.designer.cs">
<DependentUpon>MainViewController.cs</DependentUpon>
</Compile>
<Compile Include="Model\DataItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<InterfaceDefinition Include="Main_iPhone.storyboard" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Default-568h@2x.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="GalaSoft.MvvmLight">
<HintPath>..\References\PCL\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras">
<HintPath>..\References\PCL\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform">
<HintPath>..\References\iOS\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Content Include="Entitlements.plist" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,31 @@
using System.Reflection;
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("ObservableTableAndCollectionViewSource")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("ObservableTableAndCollectionViewSource")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © Laurent Bugnion (GalaSoft) 2009-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// 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("5.2.0.0")]

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Просмотреть файл

@ -0,0 +1,136 @@
using Foundation;
using System;
using System.Collections.Generic;
using GalaSoft.MvvmLight.Helpers;
using GalaSoft.MvvmLight.Views;
using Microsoft.Practices.ServiceLocation;
using ObservableTableAndCollectionViewSource.Layout;
using ObservableTableAndCollectionViewSource.Model;
using ObservableTableAndCollectionViewSource.ViewModel;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
// ReSharper disable once InconsistentNaming
partial class UITableViewTableSourceController : UITableViewController
{
private const string ReuseId = "SampleID";
private readonly List<Binding> _bindings = new List<Binding>();
private ObservableTableViewSource<DataItem> _source;
private HeaderForTableView _headerView;
private MainViewModel Vm
{
get
{
return Application.Locator.Main;
}
}
public UITableViewTableSourceController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
var nav = (NavigationService)ServiceLocator.Current.GetInstance<INavigationService>();
var useCreateCell = (bool?)nav.GetAndRemoveParameter(this);
if (useCreateCell == null || useCreateCell.Value)
{
_source = Vm.Items.GetTableViewSource(
CreateCell,
BindUiTableViewCell,
factory: () => new TableViewSourceEx());
}
else
{
_source = Vm.Items.GetTableViewSource(
BindTestTableViewCell,
ReuseId,
factory: () => new TableViewSourceEx());
TableView.RegisterClassForCellReuse(typeof(TestTableViewCell), new NSString(ReuseId));
}
_source.GetHeightForHeaderDelegate = () => 50;
_source.GetViewForHeaderDelegate = () =>
{
_headerView = new HeaderForTableView();
_bindings.Add(
this.SetBinding(
() => _source.SelectedItem.Title,
() => _headerView.SelectedItemLabel.Text,
fallbackValue: "Nothing yet"));
return _headerView;
};
TableView.Source = _source;
var addButton = new UIBarButtonItem
{
Title = "Add"
};
addButton.SetCommand(Vm.AddCommand);
var delButton = new UIBarButtonItem
{
Title = "Del"
};
var selectedItemBinding = this.SetBinding(() => _source.SelectedItem);
_bindings.Add(selectedItemBinding);
delButton.SetCommand(Vm.DeleteCommand, selectedItemBinding);
NavigationItem.RightBarButtonItems = new[]
{
delButton,
addButton,
};
}
private void BindUiTableViewCell(UITableViewCell cell, DataItem item, NSIndexPath path)
{
cell.TextLabel.Text = item.Title;
}
private void BindTestTableViewCell(UITableViewCell cell, DataItem item, NSIndexPath path)
{
((TestTableViewCell)cell).Text = item.Title;
}
private UITableViewCell CreateCell(NSString reuseId)
{
return new UITableViewCell(UITableViewCellStyle.Default, reuseId);
}
}
public class TableViewSourceEx : ObservableTableViewSource<DataItem>
{
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
base.RowSelected(tableView, indexPath);
var cell = tableView.CellAt(indexPath);
cell.ContentView.BackgroundColor = UIColor.Green;
}
public override void RowDeselected(UITableView tableView, NSIndexPath indexPath)
{
base.RowDeselected(tableView, indexPath);
var cell = tableView.CellAt(indexPath);
cell.ContentView.BackgroundColor = UIColor.White;
}
public override UITableViewCell GetCell(UITableView view, NSIndexPath indexPath)
{
var cell = base.GetCell(view, indexPath);
cell.ContentView.BackgroundColor = UIColor.White;
return cell;
}
}
}

Просмотреть файл

@ -0,0 +1,21 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace ObservableTableAndCollectionViewSource
{
[Register ("UITableViewTableSourceController")]
partial class UITableViewTableSourceController
{
void ReleaseDesignerOutlets ()
{
}
}
}

Просмотреть файл

@ -0,0 +1,64 @@
using System;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using ObservableTableAndCollectionViewSource.Model;
namespace ObservableTableAndCollectionViewSource.ViewModel
{
public class MainViewModel : ViewModelBase
{
public ObservableCollection<DataItem> Items
{
get;
private set;
}
public MainViewModel()
{
Items = new ObservableCollection<DataItem>
{
new DataItem("123"),
new DataItem("234"),
new DataItem("345"),
new DataItem("456"),
new DataItem("567"),
};
}
private RelayCommand _addCommand;
public RelayCommand AddCommand
{
get
{
return _addCommand
?? (_addCommand = new RelayCommand(
() =>
{
Items.Add(new DataItem(_random.Next(0, 1000).ToString()));
}));
}
}
private RelayCommand<DataItem> _deleteCommand;
private readonly Random _random = new Random();
public RelayCommand<DataItem> DeleteCommand
{
get
{
return _deleteCommand
?? (_deleteCommand = new RelayCommand<DataItem>(
item =>
{
if (Items.Contains(item))
{
Items.Remove(item);
}
},
item => item != null));
}
}
}
}

Просмотреть файл

@ -0,0 +1,56 @@
using System.Diagnostics.CodeAnalysis;
using GalaSoft.MvvmLight.Ioc;
using Microsoft.Practices.ServiceLocation;
namespace ObservableTableAndCollectionViewSource.ViewModel
{
/// <summary>
/// This class contains static references to the most relevant view models in the
/// application and provides an entry point for the bindings.
/// <para>
/// See http://www.mvvmlight.net
/// </para>
/// </summary>
public class ViewModelLocator
{
public const string SecondPageKey = "UITableViewTableSourceController";
public const string ThirdPageKey = "CollectionViewController";
/// <summary>
/// Gets the Main property.
/// </summary>
[SuppressMessage("Microsoft.Performance",
"CA1822:MarkMembersAsStatic",
Justification = "This non-static member is needed for data binding purposes.")]
public MainViewModel Main
{
get
{
return ServiceLocator.Current.GetInstance<MainViewModel>();
}
}
/// <summary>
/// This property can be used to force the application to run with design time data.
/// </summary>
public static bool UseDesignTimeData
{
get
{
return false;
}
}
static ViewModelLocator()
{
SimpleIoc.Default.Register<MainViewModel>();
}
/// <summary>
/// Cleans up all the resources.
/// </summary>
public static void Cleanup()
{
}
}
}

Просмотреть файл

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="xamarinios10" />
</packages>

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,460 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>GalaSoft.MvvmLight.Extras</name>
</assembly>
<members>
<member name="T:GalaSoft.MvvmLight.Ioc.ISimpleIoc">
<summary>
A very simple IOC container with basic functionality needed to register and resolve
instances. If needed, this class can be replaced by another more elaborate
IOC container implementing the IServiceLocator interface.
The inspiration for this class is at https://gist.github.com/716137 but it has
been extended with additional features.
</summary>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.ContainsCreated``1">
<summary>
Checks whether at least one instance of a given class is already created in the container.
</summary>
<typeparam name="TClass">The class that is queried.</typeparam>
<returns>True if at least on instance of the class is already created, false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.ContainsCreated``1(System.String)">
<summary>
Checks whether the instance with the given key is already created for a given class
in the container.
</summary>
<typeparam name="TClass">The class that is queried.</typeparam>
<param name="key">The key that is queried.</param>
<returns>True if the instance with the given key is already registered for the given class,
false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.IsRegistered``1">
<summary>
Gets a value indicating whether a given type T is already registered.
</summary>
<typeparam name="T">The type that the method checks for.</typeparam>
<returns>True if the type is registered, false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.IsRegistered``1(System.String)">
<summary>
Gets a value indicating whether a given type T and a give key
are already registered.
</summary>
<typeparam name="T">The type that the method checks for.</typeparam>
<param name="key">The key that the method checks for.</param>
<returns>True if the type and key are registered, false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``2">
<summary>
Registers a given type for a given interface.
</summary>
<typeparam name="TInterface">The interface for which instances will be resolved.</typeparam>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``2(System.Boolean)">
<summary>
Registers a given type for a given interface with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TInterface">The interface for which instances will be resolved.</typeparam>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``1">
<summary>
Registers a given type.
</summary>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``1(System.Boolean)">
<summary>
Registers a given type with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``1(System.Func{``0})">
<summary>
Registers a given instance for a given type.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``1(System.Func{``0},System.Boolean)">
<summary>
Registers a given instance for a given type with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``1(System.Func{``0},System.String)">
<summary>
Registers a given instance for a given type and a given key.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
<param name="key">The key for which the given instance is registered.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Register``1(System.Func{``0},System.String,System.Boolean)">
<summary>
Registers a given instance for a given type and a given key with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
<param name="key">The key for which the given instance is registered.</param>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Reset">
<summary>
Resets the instance in its original states. This deletes all the
registrations.
</summary>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Unregister``1">
<summary>
Unregisters a class from the cache and removes all the previously
created instances.
</summary>
<typeparam name="TClass">The class that must be removed.</typeparam>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Unregister``1(``0)">
<summary>
Removes the given instance from the cache. The class itself remains
registered and can be used to create other instances.
</summary>
<typeparam name="TClass">The type of the instance to be removed.</typeparam>
<param name="instance">The instance that must be removed.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.ISimpleIoc.Unregister``1(System.String)">
<summary>
Removes the instance corresponding to the given key from the cache. The class itself remains
registered and can be used to create other instances.
</summary>
<typeparam name="TClass">The type of the instance to be removed.</typeparam>
<param name="key">The key corresponding to the instance that must be removed.</param>
</member>
<member name="T:GalaSoft.MvvmLight.Ioc.PreferredConstructorAttribute">
<summary>
When used with the SimpleIoc container, specifies which constructor
should be used to instantiate when GetInstance is called.
If there is only one constructor in the class, this attribute is
not needed.
</summary>
</member>
<member name="T:GalaSoft.MvvmLight.Ioc.SimpleIoc">
<summary>
A very simple IOC container with basic functionality needed to register and resolve
instances. If needed, this class can be replaced by another more elaborate
IOC container implementing the IServiceLocator interface.
The inspiration for this class is at https://gist.github.com/716137 but it has
been extended with additional features.
</summary>
</member>
<member name="P:GalaSoft.MvvmLight.Ioc.SimpleIoc.Default">
<summary>
This class' default instance.
</summary>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.ContainsCreated``1">
<summary>
Checks whether at least one instance of a given class is already created in the container.
</summary>
<typeparam name="TClass">The class that is queried.</typeparam>
<returns>True if at least on instance of the class is already created, false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.ContainsCreated``1(System.String)">
<summary>
Checks whether the instance with the given key is already created for a given class
in the container.
</summary>
<typeparam name="TClass">The class that is queried.</typeparam>
<param name="key">The key that is queried.</param>
<returns>True if the instance with the given key is already registered for the given class,
false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.IsRegistered``1">
<summary>
Gets a value indicating whether a given type T is already registered.
</summary>
<typeparam name="T">The type that the method checks for.</typeparam>
<returns>True if the type is registered, false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.IsRegistered``1(System.String)">
<summary>
Gets a value indicating whether a given type T and a give key
are already registered.
</summary>
<typeparam name="T">The type that the method checks for.</typeparam>
<param name="key">The key that the method checks for.</param>
<returns>True if the type and key are registered, false otherwise.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``2">
<summary>
Registers a given type for a given interface.
</summary>
<typeparam name="TInterface">The interface for which instances will be resolved.</typeparam>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``2(System.Boolean)">
<summary>
Registers a given type for a given interface with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TInterface">The interface for which instances will be resolved.</typeparam>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``1">
<summary>
Registers a given type.
</summary>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``1(System.Boolean)">
<summary>
Registers a given type with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TClass">The type that must be used to create instances.</typeparam>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``1(System.Func{``0})">
<summary>
Registers a given instance for a given type.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``1(System.Func{``0},System.Boolean)">
<summary>
Registers a given instance for a given type with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``1(System.Func{``0},System.String)">
<summary>
Registers a given instance for a given type and a given key.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
<param name="key">The key for which the given instance is registered.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Register``1(System.Func{``0},System.String,System.Boolean)">
<summary>
Registers a given instance for a given type and a given key with the possibility for immediate
creation of the instance.
</summary>
<typeparam name="TClass">The type that is being registered.</typeparam>
<param name="factory">The factory method able to create the instance that
must be returned when the given type is resolved.</param>
<param name="key">The key for which the given instance is registered.</param>
<param name="createInstanceImmediately">If true, forces the creation of the default
instance of the provided class.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Reset">
<summary>
Resets the instance in its original states. This deletes all the
registrations.
</summary>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Unregister``1">
<summary>
Unregisters a class from the cache and removes all the previously
created instances.
</summary>
<typeparam name="TClass">The class that must be removed.</typeparam>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Unregister``1(``0)">
<summary>
Removes the given instance from the cache. The class itself remains
registered and can be used to create other instances.
</summary>
<typeparam name="TClass">The type of the instance to be removed.</typeparam>
<param name="instance">The instance that must be removed.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.Unregister``1(System.String)">
<summary>
Removes the instance corresponding to the given key from the cache. The class itself remains
registered and can be used to create other instances.
</summary>
<typeparam name="TClass">The type of the instance to be removed.</typeparam>
<param name="key">The key corresponding to the instance that must be removed.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetAllCreatedInstances(System.Type)">
<summary>
Provides a way to get all the created instances of a given type available in the
cache. Registering a class or a factory does not automatically
create the corresponding instance! To create an instance, either register
the class or the factory with createInstanceImmediately set to true,
or call the GetInstance method before calling GetAllCreatedInstances.
Alternatively, use the GetAllInstances method, which auto-creates default
instances for all registered classes.
</summary>
<param name="serviceType">The class of which all instances
must be returned.</param>
<returns>All the already created instances of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetAllCreatedInstances``1">
<summary>
Provides a way to get all the created instances of a given type available in the
cache. Registering a class or a factory does not automatically
create the corresponding instance! To create an instance, either register
the class or the factory with createInstanceImmediately set to true,
or call the GetInstance method before calling GetAllCreatedInstances.
Alternatively, use the GetAllInstances method, which auto-creates default
instances for all registered classes.
</summary>
<typeparam name="TService">The class of which all instances
must be returned.</typeparam>
<returns>All the already created instances of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetService(System.Type)">
<summary>
Gets the service object of the specified type.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type serviceType has not
been registered before calling this method.</exception>
<returns>
A service object of type <paramref name="serviceType" />.
</returns>
<param name="serviceType">An object that specifies the type of service object to get.</param>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetAllInstances(System.Type)">
<summary>
Provides a way to get all the created instances of a given type available in the
cache. Calling this method auto-creates default
instances for all registered classes.
</summary>
<param name="serviceType">The class of which all instances
must be returned.</param>
<returns>All the instances of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetAllInstances``1">
<summary>
Provides a way to get all the created instances of a given type available in the
cache. Calling this method auto-creates default
instances for all registered classes.
</summary>
<typeparam name="TService">The class of which all instances
must be returned.</typeparam>
<returns>All the instances of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance(System.Type)">
<summary>
Provides a way to get an instance of a given type. If no instance had been instantiated
before, a new instance will be created. If an instance had already
been created, that same instance will be returned.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type serviceType has not
been registered before calling this method.</exception>
<param name="serviceType">The class of which an instance
must be returned.</param>
<returns>An instance of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstanceWithoutCaching(System.Type)">
<summary>
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type serviceType has not
been registered before calling this method.</exception>
<param name="serviceType">The class of which an instance
must be returned.</param>
<returns>An instance of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance(System.Type,System.String)">
<summary>
Provides a way to get an instance of a given type corresponding
to a given key. If no instance had been instantiated with this
key before, a new instance will be created. If an instance had already
been created with the same key, that same instance will be returned.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type serviceType has not
been registered before calling this method.</exception>
<param name="serviceType">The class of which an instance must be returned.</param>
<param name="key">The key uniquely identifying this instance.</param>
<returns>An instance corresponding to the given type and key.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstanceWithoutCaching(System.Type,System.String)">
<summary>
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type serviceType has not
been registered before calling this method.</exception>
<param name="serviceType">The class of which an instance must be returned.</param>
<param name="key">The key uniquely identifying this instance.</param>
<returns>An instance corresponding to the given type and key.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance``1">
<summary>
Provides a way to get an instance of a given type. If no instance had been instantiated
before, a new instance will be created. If an instance had already
been created, that same instance will be returned.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type TService has not
been registered before calling this method.</exception>
<typeparam name="TService">The class of which an instance
must be returned.</typeparam>
<returns>An instance of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstanceWithoutCaching``1">
<summary>
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type TService has not
been registered before calling this method.</exception>
<typeparam name="TService">The class of which an instance
must be returned.</typeparam>
<returns>An instance of the given type.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance``1(System.String)">
<summary>
Provides a way to get an instance of a given type corresponding
to a given key. If no instance had been instantiated with this
key before, a new instance will be created. If an instance had already
been created with the same key, that same instance will be returned.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type TService has not
been registered before calling this method.</exception>
<typeparam name="TService">The class of which an instance must be returned.</typeparam>
<param name="key">The key uniquely identifying this instance.</param>
<returns>An instance corresponding to the given type and key.</returns>
</member>
<member name="M:GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstanceWithoutCaching``1(System.String)">
<summary>
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
</summary>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">If the type TService has not
been registered before calling this method.</exception>
<typeparam name="TService">The class of which an instance must be returned.</typeparam>
<param name="key">The key uniquely identifying this instance.</param>
<returns>An instance corresponding to the given type and key.</returns>
</member>
</members>
</doc>

Двоичный файл не отображается.

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичный файл не отображается.

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,268 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Practices.ServiceLocation</name>
</assembly>
<members>
<member name="T:Microsoft.Practices.ServiceLocation.ActivationException">
<summary>
The standard exception thrown when a ServiceLocator has an error in resolving an object.
</summary>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ActivationException.#ctor">
<summary>
Initializes a new instance of the <see cref="T:System.Exception" /> class.
</summary>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ActivationException.#ctor(System.String)">
<summary>
Initializes a new instance of the <see cref="T:System.Exception" /> class with a specified error message.
</summary>
<param name="message">
The message that describes the error.
</param>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ActivationException.#ctor(System.String,System.Exception)">
<summary>
Initializes a new instance of the <see cref="T:System.Exception" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.
</summary>
<param name="message">
The error message that explains the reason for the exception.
</param>
<param name="innerException">
The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.
</param>
</member>
<member name="T:Microsoft.Practices.ServiceLocation.IServiceLocator">
<summary>
The generic Service Locator interface. This interface is used
to retrieve services (instances identified by type and optional
name) from a container.
</summary>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.IServiceLocator.GetInstance(System.Type)">
<summary>
Get an instance of the given <paramref name="serviceType"/>.
</summary>
<param name="serviceType">Type of object requested.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is an error resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.IServiceLocator.GetInstance(System.Type,System.String)">
<summary>
Get an instance of the given named <paramref name="serviceType"/>.
</summary>
<param name="serviceType">Type of object requested.</param>
<param name="key">Name the object was registered with.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is an error resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.IServiceLocator.GetAllInstances(System.Type)">
<summary>
Get all instances of the given <paramref name="serviceType"/> currently
registered in the container.
</summary>
<param name="serviceType">Type of object requested.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>A sequence of instances of the requested <paramref name="serviceType"/>.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.IServiceLocator.GetInstance``1">
<summary>
Get an instance of the given <typeparamref name="TService"/>.
</summary>
<typeparam name="TService">Type of object requested.</typeparam>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.IServiceLocator.GetInstance``1(System.String)">
<summary>
Get an instance of the given named <typeparamref name="TService"/>.
</summary>
<typeparam name="TService">Type of object requested.</typeparam>
<param name="key">Name the object was registered with.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.IServiceLocator.GetAllInstances``1">
<summary>
Get all instances of the given <typeparamref name="TService"/> currently
registered in the container.
</summary>
<typeparam name="TService">Type of object requested.</typeparam>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>A sequence of instances of the requested <typeparamref name="TService"/>.</returns>
</member>
<member name="T:Microsoft.Practices.ServiceLocation.ServiceLocator">
<summary>
This class provides the ambient container for this application. If your
framework defines such an ambient container, use ServiceLocator.Current
to get it.
</summary>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocator.SetLocatorProvider(Microsoft.Practices.ServiceLocation.ServiceLocatorProvider)">
<summary>
Set the delegate that is used to retrieve the current container.
</summary>
<param name="newProvider">Delegate that, when called, will return
the current ambient container.</param>
</member>
<member name="P:Microsoft.Practices.ServiceLocation.ServiceLocator.Current">
<summary>
The current ambient container.
</summary>
</member>
<member name="T:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase">
<summary>
This class is a helper that provides a default implementation
for most of the methods of <see cref="T:Microsoft.Practices.ServiceLocation.IServiceLocator"/>.
</summary>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetService(System.Type)">
<summary>
Implementation of <see cref="M:System.IServiceProvider.GetService(System.Type)"/>.
</summary>
<param name="serviceType">The requested service.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is an error in resolving the service instance.</exception>
<returns>The requested object.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(System.Type)">
<summary>
Get an instance of the given <paramref name="serviceType"/>.
</summary>
<param name="serviceType">Type of object requested.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is an error resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(System.Type,System.String)">
<summary>
Get an instance of the given named <paramref name="serviceType"/>.
</summary>
<param name="serviceType">Type of object requested.</param>
<param name="key">Name the object was registered with.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is an error resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetAllInstances(System.Type)">
<summary>
Get all instances of the given <paramref name="serviceType"/> currently
registered in the container.
</summary>
<param name="serviceType">Type of object requested.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>A sequence of instances of the requested <paramref name="serviceType"/>.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance``1">
<summary>
Get an instance of the given <typeparamref name="TService"/>.
</summary>
<typeparam name="TService">Type of object requested.</typeparam>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance``1(System.String)">
<summary>
Get an instance of the given named <typeparamref name="TService"/>.
</summary>
<typeparam name="TService">Type of object requested.</typeparam>
<param name="key">Name the object was registered with.</param>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetAllInstances``1">
<summary>
Get all instances of the given <typeparamref name="TService"/> currently
registered in the container.
</summary>
<typeparam name="TService">Type of object requested.</typeparam>
<exception cref="T:Microsoft.Practices.ServiceLocation.ActivationException">if there is are errors resolving
the service instance.</exception>
<returns>A sequence of instances of the requested <typeparamref name="TService"/>.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.DoGetInstance(System.Type,System.String)">
<summary>
When implemented by inheriting classes, this method will do the actual work of resolving
the requested service instance.
</summary>
<param name="serviceType">Type of instance requested.</param>
<param name="key">Name of registered service you want. May be null.</param>
<returns>The requested service instance.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.DoGetAllInstances(System.Type)">
<summary>
When implemented by inheriting classes, this method will do the actual work of
resolving all the requested service instances.
</summary>
<param name="serviceType">Type of service requested.</param>
<returns>Sequence of service instance objects.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.FormatActivationExceptionMessage(System.Exception,System.Type,System.String)">
<summary>
Format the exception message for use in an <see cref="T:Microsoft.Practices.ServiceLocation.ActivationException"/>
that occurs while resolving a single service.
</summary>
<param name="actualException">The actual exception thrown by the implementation.</param>
<param name="serviceType">Type of service requested.</param>
<param name="key">Name requested.</param>
<returns>The formatted exception message string.</returns>
</member>
<member name="M:Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.FormatActivateAllExceptionMessage(System.Exception,System.Type)">
<summary>
Format the exception message for use in an <see cref="T:Microsoft.Practices.ServiceLocation.ActivationException"/>
that occurs while resolving multiple service instances.
</summary>
<param name="actualException">The actual exception thrown by the implementation.</param>
<param name="serviceType">Type of service requested.</param>
<returns>The formatted exception message string.</returns>
</member>
<member name="T:Microsoft.Practices.ServiceLocation.ServiceLocatorProvider">
<summary>
This delegate type is used to provide a method that will
return the current container. Used with the <see cref="T:Microsoft.Practices.ServiceLocation.ServiceLocator"/>
static accessor class.
</summary>
<returns>An <see cref="T:Microsoft.Practices.ServiceLocation.IServiceLocator"/>.</returns>
</member>
<member name="T:Microsoft.Practices.ServiceLocation.Properties.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:Microsoft.Practices.ServiceLocation.Properties.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:Microsoft.Practices.ServiceLocation.Properties.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:Microsoft.Practices.ServiceLocation.Properties.Resources.ActivateAllExceptionMessage">
<summary>
Looks up a localized string similar to Activation error occurred while trying to get all instances of type {0}.
</summary>
</member>
<member name="P:Microsoft.Practices.ServiceLocation.Properties.Resources.ActivationExceptionMessage">
<summary>
Looks up a localized string similar to Activation error occurred while trying to get instance of type {0}, key &quot;{1}&quot;.
</summary>
</member>
<member name="P:Microsoft.Practices.ServiceLocation.Properties.Resources.ServiceLocationProviderNotSetMessage">
<summary>
Looks up a localized string similar to ServiceLocationProvider must be set..
</summary>
</member>
</members>
</doc>