PropertyBasedDependencyObject implements IDependencyObject<T> { @Override public boolean requiresDataContext() { return this.property.requiresDataContext(); } PropertyBasedDependencyObject(@NotNull final Property<T> property, @Nullable final T def); @Override boolean requiresDataContext(); @Nullable @Override T get(@Nullable final Object context); @Override void set(@Nullable final Object context, @Nullable final T value); @Override boolean hasChanged(@Nullable final Object context);  }
@Test public void requiresDataContextFalse() { final Property<String> targetOne = new StaticValueProperty<>("Hello"); final IDependencyObject<String> depOne = new PropertyBasedDependencyObject<>(targetOne, "Default"); Assert.assertFalse(depOne.requiresDataContext()); }
@Test public void requiresDataContextTrue() { final Property<String> targetOne = new Property<>(Optional.empty(), Optional.empty(), true); final IDependencyObject<String> depOne = new PropertyBasedDependencyObject<>(targetOne, "Default"); Assert.assertTrue(depOne.requiresDataContext()); }