uwp中的RoutedCommand替换

时间:2016-02-23 11:22:27

标签: c# xaml win-universal-app

我需要在我的客户控制中创建一个RoutedCommand。我在wpf中使用过RoutedCommands但在uwp中没有使用RoutedCommand类。什么是替代品?

[编辑]似乎RoutedCommand支持的整个CommandBinding在uwp中消失了!由于还没有由FrameworkElement实现的IInputElement https://msdn.microsoft.com/en-us/library/ms752070(v=vs.100).aspx

1 个答案:

答案 0 :(得分:0)

答案可能是RelayCommand,它也实现了ICommand

    Map<String,String> hiveProperties = new HashMap<String,String>();
    hiveProperties.put("hive.vectorized.execution.enabled","true");
    hiveProperties.put("hive.vectorized.execution.reduce.enabled","true");
    hiveProperties.put("hive.execution.engine","Tez");
    hiveProperties.put("hive.auto.convert.join","true");
    hiveProperties.put("hive.exec.parallel","true");

    Configuration myHiveConfig = new Configuration()
    .withClassification("hive-site")
    .withProperties(hiveProperties);

    List <Application> apps = new ArrayList<Application>();
    apps.add(new Application().withName("Hadoop"));
    apps.add(new Application().withName("Hive"));
    apps.add(new Application().withName("Spark"));
    //apps.add(new Application().withName("Pig"));
    //apps.add(new Application().withName("Zeppelin-Sandbox"));

    RunJobFlowRequest request = new RunJobFlowRequest()
    .withName("abc")
        .withReleaseLabel(emrVersion) //"emr-4.3.0"
    .withServiceRole("EMR_DefaultRole")
    .withConfigurations(myHiveConfig)
        .withInstances(
                  new JobFlowInstancesConfig()
                        .withInstanceCount(numberofInstances)
                        .withKeepJobFlowAliveWhenNoSteps(true)
                        .withTerminationProtected(false)
                        .withMasterInstanceType(mserverType)
                        .withSlaveInstanceType(sserverType) 
                  )
    .withApplications(apps)
    .withJobFlowRole("EMR_EC2_DefaultRole")
    .withSteps(generalSteps);