public async Task SetAndAnimateTranslation() { await App.DispatcherQueue.EnqueueAsync(async() => { var button = new Button(); var grid = new Grid() { Children = { button } }; VisualExtensions.SetTranslation(button, "80, 20, 0"); await SetTestContentAsync(grid); await AnimationBuilder.Create() .Translation(to: new Vector3(11, 22, 0)) .StartAsync(button); var success = button.GetVisual().Properties.TryGetVector3("Translation", out Vector3 translation); Assert.AreEqual(success, CompositionGetValueStatus.Succeeded); Assert.AreEqual(translation, new Vector3(11, 22, 0)); string text = VisualExtensions.GetTranslation(button); Assert.AreEqual(text, new Vector3(11, 22, 0).ToString()); }); }
public async Task GetDefaultTranslation() { await App.DispatcherQueue.EnqueueAsync(() => { var button = new Button(); string text = VisualExtensions.GetTranslation(button); Assert.AreEqual(text, "<0, 0, 0>"); }); }