本文整理匯總了Java中de.saxsys.mvvmfx.MvvmFX類的典型用法代碼示例。如果您正苦於以下問題:Java MvvmFX類的具體用法?Java MvvmFX怎麽用?Java MvvmFX使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MvvmFX類屬於de.saxsys.mvvmfx包,在下文中一共展示了MvvmFX類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
import de.saxsys.mvvmfx.MvvmFX; //導入依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
stage.setTitle("TodoMVVM");
EasyDI diContext = new EasyDI();
diContext.markAsSingleton(TodoItemStore.class);
MvvmFX.setCustomDependencyInjector(diContext::getInstance);
final Parent parent = FluentViewLoader.fxmlView(MainView.class).load().getView();
final Scene scene = new Scene(parent);
stage.setScene(scene);
stage.show();
}
示例2: ItemOverviewViewModel
import de.saxsys.mvvmfx.MvvmFX; //導入依賴的package包/類
public ItemOverviewViewModel(TodoItemStore store) {
allItems = new ListTransformation<>(store.getItems(), item -> new ItemViewModel(item, () -> store.deleteItem(item)));
completedItems = FilterHelper.filter(allItems.getTargetList(), ItemViewModel::completedProperty);
activeItems = FilterHelper.filterInverted(allItems.getTargetList(), ItemViewModel::completedProperty);
showAllItems();
final NotificationCenter notificationCenter = MvvmFX.getNotificationCenter();
notificationCenter.subscribe("showAll", (key, payload) -> showAllItems());
notificationCenter.subscribe("showActive", (key, payload) -> showActiveItems());
notificationCenter.subscribe("showCompleted", (key, payload) -> showCompletedItems());
}
示例3: start
import de.saxsys.mvvmfx.MvvmFX; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
EasyDI easyDI = new EasyDI();
MvvmFX.setCustomDependencyInjector(easyDI::getInstance);
final ViewTuple<MainView, MainViewModel> viewTuple = FluentViewLoader.fxmlView(MainView.class).load();
primaryStage.setScene(new Scene(viewTuple.getView(), 600, 600));
primaryStage.show();
}
示例4: start
import de.saxsys.mvvmfx.MvvmFX; //導入依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
stage.setTitle("ColorPuzzleFX");
EasyDI context = new EasyDI();
context.bindInterface(Solver.class, BogoSolver.class);
MvvmFX.setCustomDependencyInjector(context::getInstance);
final ViewTuple<MainView, MainViewModel> viewTuple = FluentViewLoader.fxmlView(MainView.class).load();
stage.setScene(new Scene(viewTuple.getView()));
stage.sizeToScene();
stage.show();
}