Skip to content

Commit 4f162bf

Browse files
committed
Merge remote-tracking branch 'origin/master' into rxui6-master
Conflicts: NuGet/ReactiveUI-Testing/ReactiveUI-Testing.nuspec
2 parents cd7f614 + 000a252 commit 4f162bf

14 files changed

Lines changed: 521 additions & 49 deletions

NuGet/ReactiveUI-Testing/ReactiveUI-Testing.nuspec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<dependency id="reactiveui-core" version="[5.99.1-beta]" />
1919
<dependency id="Rx-Testing" version="2.2.2" />
2020
</group>
21+
<group targetFramework="WinRT45">
22+
<dependency id="reactiveui-core" version="[5.99.1-beta]" />
23+
<dependency id="Rx-Testing" version="2.2.2" />
24+
</group>
2125
<group targetFramework="monoandroid">
2226
<dependency id="reactiveui-core" version="[5.99.1-beta]" />
2327
</group>
@@ -26,4 +30,4 @@
2630
</group>
2731
</dependencies>
2832
</metadata>
29-
</package>
33+
</package>

NuGet/ReactiveUI-Testing/lib/WinRT45/ReactiveUI.Testing.dll

Whitespace-only changes.

NuGet/ReactiveUI-Testing/lib/WinRT45/ReactiveUI.Testing.pdb

Whitespace-only changes.

NuGet/ReactiveUI-Testing/lib/WinRT45/ReactiveUI.Testing.xml

Whitespace-only changes.

ReactiveUI.Platforms/Cocoa/CommonReactiveSource.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface IUICollViewAdapter<TUIView, TUIViewCell>
3131
interface ISectionInformation<TUIView, TUIViewCell>
3232
{
3333
IReactiveNotifyCollectionChanged Collection { get; }
34-
NSString CellKey { get; }
34+
Func<object, NSString> CellKeySelector { get; }
3535
Action<TUIViewCell> InitializeCellAction { get; }
3636
}
3737

@@ -168,12 +168,13 @@ public CommonReactiveSource(IUICollViewAdapter<TUIView, TUIViewCell> adapter)
168168
public TUIViewCell GetCell(NSIndexPath indexPath)
169169
{
170170
var section = SectionInfo[indexPath.Section];
171-
var cell = adapter.DequeueReusableCell(section.CellKey, indexPath);
171+
var vm = ((IList)section.Collection) [indexPath.Row];
172+
var cell = adapter.DequeueReusableCell(section.CellKeySelector(vm), indexPath);
172173
var view = cell as IViewFor;
173174

174175
if (view != null) {
175176
this.Log().Debug("GetCell: Setting vm for Row: " + indexPath.Row);
176-
view.ViewModel = ((IList)section.Collection) [indexPath.Row];
177+
view.ViewModel = vm;
177178
}
178179

179180
(section.InitializeCellAction ?? (_ => {}))(cell);

ReactiveUI.Platforms/Cocoa/LinkerOverrides.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace ReactiveUI.Cocoa.Cocoa
1313
/// <summary>
1414
/// This class exists to force the MT linker to include properties called by RxUI via reflection
1515
/// </summary>
16-
[Preserve]
16+
[Preserve(AllMembers = true)]
1717
class LinkerOverrides
1818
{
1919

ReactiveUI.Platforms/Cocoa/ReactiveCollectionViewSource.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,26 @@ public class CollectionViewSectionInformation : ISectionInformation<UICollection
2323
{
2424
public IReactiveNotifyCollectionChanged Collection { get; protected set; }
2525
public Action<UICollectionViewCell> InitializeCellAction { get; protected set; }
26-
public NSString CellKey { get; protected set; }
26+
public Func<object, NSString> CellKeySelector { get; protected set; }
2727
}
2828

2929
public class CollectionViewSectionInformation<TCell> : CollectionViewSectionInformation
3030
where TCell : UICollectionViewCell
3131
{
32-
public CollectionViewSectionInformation(IReactiveNotifyCollectionChanged collection, NSString cellKey, Action<TCell> initializeCellAction = null)
32+
public CollectionViewSectionInformation(IReactiveNotifyCollectionChanged collection, Func<object, NSString> cellKeySelector, Action<TCell> initializeCellAction = null)
3333
{
3434
Collection = collection;
35-
CellKey = cellKey;
35+
CellKeySelector = cellKeySelector;
3636

3737
if (initializeCellAction != null) {
3838
InitializeCellAction = cell => initializeCellAction((TCell)cell);
3939
}
4040
}
41+
42+
public CollectionViewSectionInformation(IReactiveNotifyCollectionChanged collection, NSString cellKey, Action<TCell> initializeCellAction = null)
43+
: this(collection, _ => cellKey, initializeCellAction)
44+
{
45+
}
4146
}
4247

4348
class UICollectionViewAdapter : IUICollViewAdapter<UICollectionView, UICollectionViewCell>

ReactiveUI.Platforms/Cocoa/ReactiveTableViewSource.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class TableSectionInformation : ISectionInformation<UITableView, UITableV
2323
{
2424
public IReactiveNotifyCollectionChanged Collection { get; protected set; }
2525
public Action<UITableViewCell> InitializeCellAction { get; protected set; }
26-
public NSString CellKey { get; protected set; }
26+
public Func<object, NSString> CellKeySelector { get; protected set; }
2727
public float SizeHint { get; protected set; }
2828

2929
/// <summary>
@@ -42,14 +42,19 @@ public class TableSectionInformation : ISectionInformation<UITableView, UITableV
4242
public class TableSectionInformation<TCell> : TableSectionInformation
4343
where TCell : UITableViewCell
4444
{
45-
public TableSectionInformation(IReactiveNotifyCollectionChanged collection, NSString cellKey, float sizeHint, Action<TCell> initializeCellAction = null)
45+
public TableSectionInformation(IReactiveNotifyCollectionChanged collection, Func<object, NSString> cellKeySelector, float sizeHint, Action<TCell>initializeCellAction = null)
4646
{
4747
Collection = collection;
48-
CellKey = cellKey;
4948
SizeHint = sizeHint;
49+
CellKeySelector = cellKeySelector;
5050
if (initializeCellAction != null)
5151
InitializeCellAction = cell => initializeCellAction((TCell)cell);
5252
}
53+
54+
public TableSectionInformation(IReactiveNotifyCollectionChanged collection, NSString cellKey, float sizeHint, Action<TCell> initializeCellAction = null)
55+
: this(collection, _ => cellKey, sizeHint, initializeCellAction)
56+
{
57+
}
5358
}
5459

5560
class UITableViewAdapter : IUICollViewAdapter<UITableView, UITableViewCell>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProductVersion>8.0.30703</ProductVersion>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{1ACA04C7-F566-4095-8306-7947428230F3}</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>ReactiveUI.Testing</RootNamespace>
13+
<AssemblyName>ReactiveUI.Testing</AssemblyName>
14+
<DefaultLanguage>en-US</DefaultLanguage>
15+
<FileAlignment>512</FileAlignment>
16+
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\WinRT45\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\WinRT45\</OutputPath>
31+
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<DocumentationFile>bin\Release\WinRT45\ReactiveUI.Testing.xml</DocumentationFile>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Compile Include="Properties\AssemblyInfo.cs" />
38+
<Compile Include="TestUtils.cs" />
39+
</ItemGroup>
40+
<ItemGroup>
41+
<Reference Include="Microsoft.Reactive.Testing">
42+
<HintPath>..\ext\winrt\Microsoft.Reactive.Testing.dll</HintPath>
43+
</Reference>
44+
<Reference Include="System.Reactive.Core">
45+
<HintPath>..\ext\winrt\System.Reactive.Core.dll</HintPath>
46+
</Reference>
47+
<Reference Include="System.Reactive.Interfaces">
48+
<HintPath>..\ext\winrt\System.Reactive.Interfaces.dll</HintPath>
49+
</Reference>
50+
<Reference Include="System.Reactive.Linq">
51+
<HintPath>..\ext\winrt\System.Reactive.Linq.dll</HintPath>
52+
</Reference>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj">
56+
<Project>{464cb812-f99f-401b-be4c-e8f0515cd19d}</Project>
57+
<Name>ReactiveUI</Name>
58+
</ProjectReference>
59+
</ItemGroup>
60+
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
61+
<VisualStudioVersion>11.0</VisualStudioVersion>
62+
</PropertyGroup>
63+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
64+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
65+
Other similar extension points exist, see Microsoft.Common.targets.
66+
<Target Name="BeforeBuild">
67+
</Target>
68+
<Target Name="AfterBuild">
69+
</Target>
70+
-->
71+
</Project>

0 commit comments

Comments
 (0)