-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation #771
Closed
Closed
Documentation #771
Changes from all commits
Commits
Show all changes
180 commits
Select commit
Hold shift + click to select a range
ab643d8
initial documentation structure using mkdocs + rtd
ghuntley 1a9124a
what is this doing here?
shiftkey d874f5e
linkify this
shiftkey b0d132f
stub a section for ReactiveObject
shiftkey 6b47e3d
port over the old doc for ReactiveObject
shiftkey d302cb7
updated README to be more developer-focused
shiftkey ddfbe44
removed dropbox merge conflict
ghuntley 5348fab
migrated release notes for rx6 and rx5
ghuntley 086e21f
added out of the tarpit
ghuntley fff0f0e
added frp presentation by @shiftkey
ghuntley 5d593f5
branch, pull and release based development workflow
ghuntley 1c8877a
fleshed out error handling
ghuntley ab4ed0a
Create recovery-options.md
ghuntley 4f73768
Create user-errors.md
ghuntley 2276bff
start migrating legacy docs to new structure
rdavisau b495817
added versioning info
ghuntley b352b48
Update README.md
ghuntley e7d012a
Update README.md
ghuntley 00797d3
added link to historical pdf
ghuntley c8ceebf
Short description with learning resources for Rx
DarekDan 089f04a
Missed a hyphen
DarekDan e8357f3
Merge branch 'readthedocs' of https://github.com/ghuntley/ReactiveUI …
DarekDan 978f6ec
A section on MVVM
DarekDan 1ae6396
Missed a bracket
DarekDan 5856d05
Typos
DarekDan 12cd7af
Typos
DarekDan 59dadb5
Typos
DarekDan 257f36b
Updated Rx sample
DarekDan f2b6a2c
Added one more link to samples
DarekDan 302fdef
Additional git ignores
DarekDan cfd2fa9
Added ReactiveUI 101. Need help with code formatting.
DarekDan fa6aebb
Missed a ref
DarekDan 68898f5
Typos and formatting
DarekDan 6d8c825
Attempt to reduce "bold code"
DarekDan 920c644
Modified example for Flickr
DarekDan 1582dc8
Create handling-exceptions-from-long-running-tasks.md
ghuntley 8caf785
Update handling-exceptions-from-long-running-tasks.md
ghuntley 63edb02
Update xamarin-forms.md
ghuntley 9dbdbd3
Update index.md
ghuntley f89ef5f
Update index.md
ghuntley 338e4a6
Update index.md
ghuntley c6c9d16
Update index.md
ghuntley 1000a41
Update index.md
ghuntley 5c2866b
Update index.md
ghuntley b75fa05
Update index.md
ghuntley 1d0a985
Create misc.md
ghuntley 79dacfd
Update reactiveui.md
ghuntley f5b671c
few small typos
rdavisau b252b3a
service location examples now use splat
rdavisau 343bf70
Create apple-ios.md
ghuntley 2fb71bd
Create ireactivecommand.md
ghuntley ef91c7c
Update mkdocs.yml
ghuntley 2ee9449
Update reactive-command-async.md
ghuntley 5851cc8
Update reactive-command-async.md
ghuntley 0a61831
Create type-converters.md
ghuntley 4fef148
Update mkdocs.yml
ghuntley 7f4d506
Update mkdocs.yml
ghuntley 9c4dd07
Update type-converters.md
ghuntley 68fc540
Update type-converters.md
ghuntley 8e33728
Update type-converters.md
ghuntley 00698cd
Update type-converters.md
ghuntley 9ef40ea
Update type-converters.md
ghuntley 80595b8
Update type-converters.md
ghuntley 2c2e539
Update type-converters.md
ghuntley 15fff07
Update type-converters.md
ghuntley 58ad16b
Update type-converters.md
ghuntley f57cc46
Update type-converters.md
ghuntley 3f3dcfc
Update type-converters.md
ghuntley 5be67b3
Update type-converters.md
ghuntley 707d59f
removed duplicate.
ghuntley 2dc516a
removed
ghuntley d054aa2
Update mkdocs.yml
ghuntley 03fcc9c
Update .gitignore
ghuntley 6e27c57
Fixes https://github.com/reactiveui/ReactiveUI/pull/833
ghuntley 96de47a
Update ios.md
ghuntley 2cd58cd
Create xaml.md
ghuntley 2abcd15
Create android.md
ghuntley 1aa40c3
added more info about conversionHints and how they work
ghuntley 355d2d5
Create exception-handling.md
ghuntley 5d304c3
Update index.md
ghuntley 5214b52
added elm talk
ghuntley 778fa9f
Create activation.md
ghuntley b9f5277
added shiftkeys presentation, restructured video section
ghuntley 893a1f7
Fix typo in ReactiveUI.
andrewtobin f5765e1
Merge pull request #2 from andrewtobin/readthedocs
ghuntley f90a9c3
Create thread-troubleshooting.md
ghuntley 8603d57
Update thread-troubleshooting.md
ghuntley eb1efbc
Rename thread-troubleshooting.md to threading.md
ghuntley b989d7c
added troubleshooting section.
ghuntley 3e2f2ea
Update mkdocs.yml
ghuntley 9868288
Flesh out the bindings documentation
flagbug baab104
The view should implement IViewFor
flagbug d2a1f7e
Explain the WireUpControls method
flagbug 0611f52
Flesh out some explanations and move the ViewModel code to the front
flagbug fbf692d
Explain the return value of OneWayBind and friends and explain where …
flagbug 6274ec8
ReactiveAsyncCommand -> ReactiveCommand
flagbug f652860
Write some words about the solution layout
flagbug 9ba47c2
Shorten the code with C# 6
flagbug 7ef8ccc
inlined link
shiftkey c77ffb1
Replace ObservableForProperty with WhenAnyValue
flagbug c1d6910
Pull the Select call down, for better readability
flagbug 3c50252
Add a subscription to the "ThrownExceptions" of the ReactiveCommand
flagbug d48e8b8
Write some more details about the one-way bind conversion parameter
flagbug faa7926
Move the comment up
flagbug 6b9da69
Fix some documentation around ReactiveCommand
flagbug 47898dc
Merge pull request #6 from flagbug/fix-command-docs
flagbug 65b9e32
Merge pull request #5 from flagbug/improve-documentation-2
flagbug 35c7135
Merge pull request #3 from flagbug/improve-documentation-1
flagbug e57ca3a
added UWP support statement.
ghuntley 26a5598
Create autoexec-commands.md
ghuntley 8932d10
Update wpf.md
ghuntley 75074b6
Update index.md
ghuntley 2acd907
added caching section
ghuntley 7a1c36f
Update mkdocs.yml
ghuntley fe1ff4c
added reminder that autoexecution should be done via view
ghuntley bda83ce
added exception handling section
ghuntley 41ae5d0
added designtime section
ghuntley de37048
added design time example
ghuntley acb32f3
Update mkdocs.yml
ghuntley 2ea9e05
added events/windows-forms.md
ghuntley ae915a9
created explanation of events packages.
ghuntley 6c8db73
added link to espera.
ghuntley 8c8559a
added more info about when to use WhenActivated
ghuntley 57d8978
added when-activated
ghuntley fbe2611
added when activated
ghuntley dfa015d
added more detail.
ghuntley 7c31169
added more info about dp leaks
ghuntley e0a6cd2
added rebracer information
ghuntley ad822c6
Mr Hyde was here …
ghuntley 9970623
migrated to gitbooks
ghuntley 861a695
moved to gitbooks
ghuntley eb9487e
migrated to gitbooks
ghuntley 5beb760
moved to gitbooks
ghuntley a5c2aac
moved to gitbooks
ghuntley 0e809fa
moved to gitbooks
ghuntley 2435458
moved to gitbooks
ghuntley 53bc6e1
moved to gitbooks
ghuntley 825acb9
migrated to gitbooks
ghuntley f495c3d
Delete index.md
ghuntley 424efdf
Delete autofac.md
ghuntley c099ebc
Delete type-converters.md
ghuntley a1b51ee
migrated to gitbooks
ghuntley 3c20e50
migrated to gitbooks
ghuntley c21c145
migrated to github
ghuntley bd676ce
migrated to gitbooks
ghuntley 78675d1
migrated to gitbooks
ghuntley 6e7e95d
moved to gitbooks
ghuntley 0bf154a
Delete index.md
ghuntley 637c8f4
Delete branch-and-pull-based-workflow.png
ghuntley b5eba87
Delete automatic-execution.md
ghuntley e95c391
Delete exception-handling.md
ghuntley f210220
moved to gitbooks
ghuntley c931e2c
Delete ireactivecommand.md
ghuntley 3f54ba6
Delete index.md
ghuntley c83e5dc
Delete misc.md
ghuntley 4df1d11
Delete index.md
ghuntley e649b47
Delete recovery-options.md
ghuntley fa6f183
Delete user-errors.md
ghuntley 283c35c
Delete index.md
ghuntley ae71ae5
Delete windows-forms.md
ghuntley fad74fa
Delete reactive-list-create-derived-collection.md
ghuntley a96f621
Delete when-activated.md
ghuntley 40cd63f
Delete reactive-object.md
ghuntley b658e77
Delete reactive-list.md
ghuntley c9e1ebc
Delete solution-layout.md
ghuntley 197013c
Delete index.md
ghuntley b5766dc
Delete ReactiveUI-101.md
ghuntley cd9406b
Delete index.md
ghuntley 50cb0fc
Delete nlog.md
ghuntley bdf5912
Delete splat.md
ghuntley 84e3952
Delete index.md
ghuntley 5f06906
Delete xamarin-forms.md
ghuntley 42b91c7
Delete reactiveui.md
ghuntley 2b58336
Delete index.md
ghuntley 25f3a45
Delete index.md
ghuntley f86cfd3
Delete index.md
ghuntley e54d6e8
Delete apple-ios.md
ghuntley d577292
Delete threading.md
ghuntley ff6d73d
Delete search.md
ghuntley 24e0872
Delete release-notes.md
ghuntley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# ReactiveUI Documentation | ||
|
||
The source for ReactiveUI documentation is here under `sources/` and uses extended | ||
Markdown, as implemented by [MkDocs](http://mkdocs.org). | ||
|
||
These files are built and deployed to [docs.reactiveui.net](http://docs.reactiveui.net) | ||
whenever `master` is updated. | ||
|
||
## Contributing | ||
|
||
### Pre-requisites | ||
|
||
On Windows, you should use | ||
[Chocolatey](http://chocolatey.org/) to setup your local environment: | ||
|
||
# cinst python2 | ||
# cinst pip | ||
|
||
On OS X, you should use [Homebrew](http://brew.sh/): | ||
|
||
# brew install python | ||
|
||
Once you've done that, install [MkDocs](http://mkdocs.org) from the command line: | ||
|
||
# pip install mkdocs | ||
|
||
### Build and Test | ||
|
||
Run this command from the root of the ReactiveUI repository: | ||
|
||
# mkdocs serve | ||
|
||
And point your browser to `http://localhost:8000` to view the documentation running | ||
locally. As files are changed, MkDocs will rebuild the documentation in the | ||
background. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```cs | ||
/* COOLSTUFF: What is the AppBootstrapper? | ||
* | ||
* The AppBootstrapper is like a ViewModel for the WPF Application class. | ||
* Since Application isn't very testable (just like Window / UserControl), | ||
* we want to create a class we can test. Since our application only has | ||
* one "screen" (i.e. a place we present Routed Views), we can also use | ||
* this as our IScreen. | ||
* | ||
* An IScreen is a ViewModel that contains a Router - practically speaking, | ||
* it usually represents a Window (or the RootFrame of a WinRT app). We | ||
* should technically create a MainWindowViewModel to represent the IScreen, | ||
* but there isn't much benefit to split those up unless you've got multiple | ||
* windows. | ||
* | ||
* AppBootstrapper is a good place to implement a lot of the "global | ||
* variable" type things in your application. It's also the place where | ||
* you should configure your IoC container. And finally, it's the place | ||
* which decides which View to Navigate to when the application starts. | ||
*/ | ||
``` |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
is it still impossible to use RXUI binding inside ItemTemplate? | ||
|
||
paulcbetts [5:35 AM] | ||
Yes | ||
|
||
ionoy [5:35 AM] | ||
damn | ||
|
||
paulcbetts [5:35 AM] | ||
Well, inside an implicit DataTemplate | ||
|
||
paulcbetts [5:36 AM] | ||
You have to create a UserControl | ||
|
||
paulcbetts [5:36 AM] | ||
The good news is, if you use `OneWayBind` to set the ItemsSource, we'll set up a DataTemplate for you | ||
|
||
ionoy [5:37 AM] | ||
can you elaborate? if I have an Items collection and one way bind it to my list, how should I name this UserControl then? (for you to automatically set it as DataTemplate) (edited) | ||
|
||
paulcbetts [5:38 AM] | ||
You can name it whatever you want, as long as: | ||
1. The UserControl implements `IViewFor<TheViewModelYourePuttingIntoThatList>` | ||
2. You register the View: `Locator.CurrentMutable.Register(() => new MyUserControl, typeof(IViewFor< TheViewModelYourePuttingIntoThatList>));` | ||
|
||
ionoy [5:38 AM] | ||
oh, awesome | ||
|
||
paulcbetts [5:39 AM] | ||
The end result is, in ReactiveUI you end up writing a bit more UserControls, but your XAML is cleaner | ||
|
||
ionoy [5:39 AM] | ||
this is actually a very good solution | ||
|
||
paulcbetts [5:39 AM] | ||
Because your ListBox can now be as simple as `<ListBox x:Name="MyList" />` | ||
|
||
ionoy [5:39 AM] | ||
yep | ||
|
||
ionoy [5:49 AM] | ||
hm, one downside is that my design time data isn't displayed nicely anymore... | ||
|
||
paulcbetts [5:59 AM] | ||
Design time data is the best part of ReactiveUI | ||
|
||
paulcbetts [5:59 AM] | ||
So, the way you do design time data, is that you just *set the property* to whatever you want | ||
|
||
paulcbetts [5:59 AM] | ||
And at runtime, the RxUI binding will override it | ||
|
||
paulcbetts [6:00 AM] | ||
It works with ItemsControls too | ||
|
||
paulcbetts [6:01 AM] | ||
```<ListBox x:Name="Foo"> | ||
<ListBox.Items> <!-- At runtime, ItemsSource trumps Items --> | ||
<MyControl /> | ||
<MyControl /> | ||
<MyControl /> | ||
</ListBox.Items> | ||
</ListBox> | ||
|
||
|
||
moswald [6:14 AM] | ||
the only downside is that if you are setting your `ItemsSource` from within a call to `WhenActivated` , your design-time data ends up showing up for a frame or two | ||
|
||
moswald [6:14 AM] | ||
the solution is to manually clear your design-time data at the bottom of your constructor in those cases | ||
|
||
ionoy [6:56 AM] | ||
@moswald: I set design time data via '{Binding Source={d:DesignInstance Type=models:DesignTimeData, IsDesignTimeCreatable=True}}', so it doesn't show when app is started |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
paulcbetts [8:59 AM] | ||
@ghuntley: At a high level, the single View is being pushed on and off the IScreen, yeah | ||
|
||
paulcbetts [9:00 AM] | ||
Not familiar with the concept of Presenters | ||
|
||
ghuntley [9:11 AM] | ||
Customization of the behavior of views when navigating between ViewModels. For example pushing on and off UINavigationViewController, switching between uitabbarcontroller options, displaying as splitviewcontroller on iPad but hamburger on iPhone. | ||
|
||
ghuntley [9:11 AM] | ||
http://4.bp.blogspot.com/-Vg7F4u_Unew/UaXgifRFsfI/AAAAAAAAA2o/GIVg5-VM6tM/s1600/redblue1.png (27KB) | ||
|
||
|
||
ghuntley [9:11 AM] | ||
http://4.bp.blogspot.com/-6UzllelBSj4/UaXgjuLbkcI/AAAAAAAAA2w/Cs23N8j8sIM/s1600/redblue2.png (7KB) | ||
|
||
|
||
paulcbetts [9:12 AM] | ||
Ah, in that case you'd have to create your own `RoutedViewHost` which isn't too hard | ||
|
||
ghuntley [9:13 AM] | ||
:heart: | ||
|
||
https://github.com/reactiveui/ReactiveUI/blob/master/ReactiveUI/Xaml/RoutedViewHost.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
We suggest the following logical naming pattern when laying out your solution: | ||
|
||
<img> | ||
|
||
|
||
All application logic is stored within a core portable class library which is shared between and referenced in each specific platform application: | ||
|
||
.Core | ||
----- | ||
|
||
A portable class library that will be the heart of the application and where you will spend most of your time. Profile259 is the recommended profile which should be used, you will need to select it when you create the project. | ||
|
||
.Core.Tests | ||
----------- | ||
|
||
A standard class library that contains unit tests that confirm functionality of .Core. | ||
|
||
.Droid | ||
------- | ||
|
||
A monodroid (Xamarin.Android) application which contains Android user interface code for both phone and tablet. Please note .Android namespace prefix is reserved by Google for Android internals and must not be used. | ||
|
||
.iOS | ||
----- | ||
|
||
A monotouch (Xamarin.iOS) application which contains iOS user interface code for both iPhone and iPad. | ||
|
||
.Mac | ||
---- | ||
|
||
A monomac (Xamarin.Mac) application which contains OSX user interface code. | ||
|
||
.WindowsPhone | ||
------------- | ||
|
||
A Windows Phone application which contains the user interface code. | ||
|
||
.WindowsStore | ||
------------- | ||
|
||
Windows 8 Store application with contains the user interface code. | ||
|
||
.Wpf | ||
---- | ||
|
||
Windows Presentation Foundation applications with contains the user interface code. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# View Location + IViewFor | ||
|
||
View Location is a feature of ReactiveUI that allows you to associate Views with | ||
ViewModels and set them up Automagically. | ||
|
||
### ViewModelViewHost | ||
|
||
The easiest way to use View Location is via the `ViewModelViewHost` control, | ||
which is a View (on Cocoa, a UIView/NSView, and on XAML-based platforms a | ||
Control) which has a single `ViewModel` property. When the ViewModel property is | ||
set, View Location looks up the associated View and loads it into the container. | ||
`ViewModelViewHost` is great for lists - so much so, that if you Bind to | ||
`ItemsSource` on XAML-based platforms and don't set a DataTemplate, one gets | ||
configured that just uses `ViewModelViewHost`. | ||
|
||
```xml | ||
<ListBox x:Name="ToasterList" /> | ||
``` | ||
|
||
```cs | ||
// Now ListBox automatically gets a DataTemplate | ||
this.OneWayBind(ViewModel, vm => vm.ToasterList, v => v.ToasterList.ItemsSource); | ||
``` | ||
|
||
### Registering new Views | ||
|
||
To use View Location, you must first register types, via Splat's Service Location feature. | ||
|
||
```cs | ||
Locator.CurrentMutable.Register(() => new ToasterView(), typeof(IViewFor<ToasterViewModel>)); | ||
``` | ||
|
||
View Location internally uses a class called `ViewLocator` which can either be | ||
replaced, or the default one used. The `ResolveView` method will return the View | ||
associated with a given ViewModel object. | ||
|
||
|
||
### Registering multiple views for a single ViewModel | ||
In order to register multiple views for the same ViewModel the contract parameter must be used on registration. Here I register 2 views with 2 contracts. Landscape and Portrait. There is no significance to the contract name. I just used these to be descriptive. | ||
|
||
```cs | ||
Locator.CurrentMutable.Register(() => new LandscapeLayoutView(), typeof(IViewFor<MainLayoutViewModel>), "Landscape"); | ||
Locator.CurrentMutable.Register(() => new PortraitLayoutView(), typeof(IViewFor<MainLayoutViewModel>), "Portrait"); | ||
|
||
``` | ||
|
||
To change your view (note that the view must be displayed in a `ViewModelViewHost`),create a new `ViewContractObservable` for the `ViewModelViewHost`. | ||
|
||
For example, if I have a `ViewModelViewHost` named mainPanel declared in XAML, then I could setup changing its displayed view like this: | ||
|
||
```cs | ||
public partial class ShellView : Window, IViewFor<ShellViewModel> | ||
{ | ||
var mainLayoutChange = new BehaviorSubject<string>("Landscape"); //start with landscape | ||
|
||
//ViewContractObservable takes an IObservable<string> | ||
this.mainPanel.ViewContractObservable = mainLayoutChange; | ||
... | ||
//to change between the views, fire the IObservable<string> | ||
//OnNext with a valid contract identifier. | ||
someSubsciption | ||
.Where(_=> someCondition) | ||
.Subscibe(_=> mainLayoutChange.OnNext("Portrait")); | ||
|
||
someSubsciption | ||
.Where(_=> someOtherCondition) | ||
.Subscibe(_=> mainLayoutChange.OnNext("Landscape")); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```cs | ||
/// <summary> | ||
/// It's usually a good idea to create an interface for every ViewModel and | ||
/// reference that instead of the implementation. This makes creating fake | ||
/// versions or design-time versions of ViewModels much easier. | ||
/// </summary> | ||
public interface ITeamLoginTitleViewModel | ||
{ | ||
[IgnoreDataMember] | ||
ReactiveCommand<Object> LoginToThisTeam { get; } | ||
|
||
[DataMember] | ||
TeamWithUser Model { get; } | ||
} | ||
|
||
|
||
public class TeamLoginTitleViewModel : ReactiveObject, ITeamLoginTitleViewModel | ||
{ | ||
|
||
} | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Don't | ||
Don't suffix `ReactiveCommand` properties' names with `Command`; instead, name the property using a verb that describes the command's action. For example: | ||
|
||
```cs | ||
|
||
public ReactiveCommand Synchronize { get; private set; } | ||
|
||
// and then in the ctor: | ||
|
||
Synchronize = ReactiveCommand.CreateAsyncObservable( | ||
_ => SynchronizeImpl(mergeInsteadOfRebase: !IsAhead)); | ||
``` | ||
|
||
When a `ReactiveCommand`'s implementation is too large or too complex for an anonymous delegate, name the implementation's method the same name as the command, but with `Impl` suffixed (for example, `SychronizeImpl` above). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Prefer binding user interactions to commands rather than methods. | ||
|
||
# Do | ||
|
||
```cs | ||
// In XAML | ||
<Button Command="{Binding Delete}" .../> | ||
|
||
public class RepositoryViewModel : ReactiveObject | ||
{ | ||
public RepositoryViewModel() | ||
{ | ||
Delete = ReactiveCommand.CreateAsyncObservable(x => DeleteImpl()); | ||
Delete.ThrownExceptions.Subscribe(ex => /*...*/); | ||
} | ||
|
||
public ReactiveAsyncCommand Delete { get; private set; } | ||
|
||
public IObservable<Unit> DeleteImpl() {...} | ||
} | ||
``` | ||
# Don't | ||
|
||
Use the Caliburn.Micro conventions for associating buttons and commands: | ||
|
||
``` | ||
// In XAML | ||
<Button x:Name="Delete" .../> | ||
|
||
public class RepositoryViewModel : PropertyChangedBase | ||
{ | ||
public void Delete() {...} | ||
} | ||
``` | ||
|
||
# Why? | ||
- ReactiveCommand exposes the `CanExecute` property of the command to enable applications to introduce additional behaviour. | ||
- It handles marshaling the result back to the UI thread. | ||
- It tracks in-flight items. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The following recommendations are intended to help keep ReactiveUI code predictable, understandable, and fast. | ||
|
||
They are, however, only a set of practices to help maintain sanity when building RxUI client applications distilled from hard lessons learned. Use best judgment when determining whether to apply the recommendations here to a given piece of code. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to set this in your mkdocs.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨