Comments (2)
Would it be possible to get a reproduction of this? I'm not sure how to try to figure out how to correct the problem (or point you in the right direction) without something I can debug.
from fsharp.viewmodule.
It seems it got nothing to do with multibinding. I think I'm doing something wrong:) Minimized sample:
Mainwindow.xaml:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:ViewModel;assembly=fsxamltest">
<Window.DataContext>
<local:MainViewModel/>
</Window.DataContext>
<WrapPanel>
<Button Content="pass the grid" Command="{Binding GridReceiverCommand}" CommandParameter="{Binding ElementName=TheGrid,Mode=OneWay}"/>
<DataGrid Name="TheGrid"/>
</WrapPanel>
</Window>
App.xaml:
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml"/>
Program.fs:
open System
type App = FsXaml.XAML< "App.xaml">
[<STAThread;EntryPoint>]
let main _ = App().Root.Run()
VM.fs:
namespace ViewModel
open FSharp.ViewModule
open System.Windows.Controls
open System
type Command() =
let canExecuteChanged = new Event<EventHandler, EventArgs>()
interface INotifyCommand with
member __.CanExecute _ = true
[<CLIEvent>]
member __.CanExecuteChanged = canExecuteChanged.Publish
member __.Execute p =
let dg = p :?> DataGrid
printfn "executed!"
member __.RaiseCanExecuteChanged() = failwith "not implemented"
type MainViewModel() as me =
inherit ViewModelBase()
let cmd1 = me.Factory.CommandSyncParamChecked((fun dg -> printfn "called!"), fun _ -> true)
let cmd2 = Command()
member __.GridReceiverCommand =
cmd1
// cmd2
Note that it works with this minimal Command
interface.
EDIT: this make it work again for some reason.
from fsharp.viewmodule.
Related Issues (20)
- Constructor fails inside an array under xUnit HOT 5
- OperationExecuting probably not working correctly. HOT 1
- Unable to load the FSharp.ViewModule project in Visual Studio 2015 update 1 HOT 4
- TypeProvider removed with no migration plan or forwarding address HOT 3
- CommandAsyncChecked does not respect CanExecute's return value HOT 6
- Should be able to execute a CommandAsyncChecked-generated command multiple times HOT 2
- Add OperationExecuting as a dependency to Async commands
- Where is this.Factory.SetPropertyDependencies? HOT 2
- Auto-generated UI from F# types HOT 3
- Samples, documentation HOT 1
- XAML editor indicates DataContext does not support view model's type HOT 4
- RaiseCanExecuteChanged does not fire? HOT 13
- EventViewModelBase Backing Field causes XamlObjectWriterException HOT 6
- Execption raises when asynchronous call to a dependent propertie HOT 3
- CollectionChanged not triggering the PropertyDependencies of a Factory.CommandSyncChecked HOT 5
- Backing fields throwing an exception for duplicated keys
- Publish FSharp.ViewModule to NuGet and change FsXaml to get FSharp.ViewModule from NuGet HOT 1
- AppVeyor build is failing HOT 1
- Factory.EventValueCommand does not handle null properly..(?) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.viewmodule.