Coder Social home page Coder Social logo

adaptivetriggerlibrary's People

Contributors

herdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adaptivetriggerlibrary's Issues

MultiTriggers not performing as expected when used in several visual states

Hello,

I have noticed that visual states cannot be resolved in the following situation:

2019-12-03 14_06_18-PEAKnx Visu - Microsoft Visual Studio  (Administrator)

Namely, If two states have exactly the same trigger, as a part of a multitrigger, the state cannot be correctly resolved. I've noticed this because a specific part of my XAML is being loaded only if a specific condition, set using multiple triggers, is met. This part of XAML contains an element that is customized from code behind, but the element remains null even though the conditions are met (scale = 200, orientation = portrait, Portrait_Scale200 state). If I remove the "scale" condition from the Landscape_Scale200 visual state, the app is able to resolve the state and present an appropriate XAML.

Why is this happening and what would be the proper way to setup multtriggers in this particular situation?

Using multiple ControlWidthTrigger

Hi,
I think I'm missing something fundamental here but how could I use multiple ControlWidthTrigger on the same TargetElement? Let's say I have a control X that should have the color green when width >= 200, red when width >= 300 and blue when width >= 400.
If I just use 3 Triggers, all of them fire when the width is >= 400 as they function independently of each other. The UWP AdaptiveTrigger (relating to Window Size) works exclusively though (having 3 triggers for three window states, they seem to exclude one another).
How can we implement this behavior without adding a "Start" AND an "End" property ("from width 200 to width 300")?

AdaptiveTriggers that set TargetElement in code-behind must be nulled otherwise they cause a memory leak

I've been having an issue with memory leaks in my UWP app and noticed that quite a few of the AdaptiveTriggers I was using in my applications were being help onto in memory. After some investigation I found that nulling the TargetElement when the view is Unloaded the memory was freed.

Below is an example fix to your MainPage.xaml.cs

    private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs) {
      HorizontalRectangleFillTrigger.TargetElement = null;
      VerticalRectangleFillTrigger.TargetElement = null;
      Unloaded -= OnUnloaded;
    }

*Edit
Not necessarily an issue, just something I wanted to flag to you and anyone else using your AdaptiveTriggerLibrary. Maybe it's something you could apply to your Wiki.

NuGet unable to resolve AdaptiveTriggerLibrary (>= 1.1.1)

Unfortunately, adding the AdaptiveTriggerLibrary v1.1 to my project via NuGet fails:


Using source https://api.nuget.org/v3/index.json.
Using source https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/.
Restoring packages for UAP,Version=v10.0...
CACHE https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/FindPackagesById()?id='AdaptiveTriggerLibrary'
CACHE https://az320820.vo.msecnd.net/v3-flatcontainer/adaptivetriggerlibrary/index.json
Resolving conflicts for UAP,Version=v10.0...
Unable to resolve AdaptiveTriggerLibrary (โ‰ฅ 1.1.1) for UAP,Version=v10.0.


Adding any 1.0 version of AdaptiveTriggerLibrary still works though.

In any case: AdaptiveTriggerLibrary is a splendid thing!

StateTrigger with bound bool property

Hello,

is there any trigger which works the same way like StateTrigger with IsActive property?
I mean if I can use any from your triggers like logical trigger with bound bool property.

Thank you,
Jakub

ConnectivityTrigger error on UWP

Hi, I'm using your nice library on my project.
I had trouble in using ConnectivityTrigger on project, when a changes made on network state I was getting the following error:
the application called an interface that was marshalled for a different thread. (exception from hresult: 0x8001010e (rpc_e_wrong_thread))

I've searched & said that the code should run on UI thread. After a lot of problem and tests, I found that the SetActive(IsActive); on line 68 of AdaptiveTriggerBase.cs is the cause of that error, I surrounded the block with a Dispatcher.RunAsync and errors gone.

Error When Using User Interface Control Width Trigger

When implementing the nuget package and attempting to use the user interface control width trigger I receive the following error:

Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in "filepath" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.

I have not been able to find a solution to this error. When I remove the reference to the nuget package the problem is resolved.

Is there a solution for this issue? I am working in UWP (min version 1809, target version 1903)

Potential memory leak with Modifiers when added as Resources to individual pages

Not sure if this is an issue or not with the library, but I was seeing lots of memory leaks in my apps Views. Turned out it was the Modifiers being held onto by each Page and never releasing them for GC. A workaround to this issue I found was to set your Modifiers in the Applications resources like below:

  <Application.Resources>
    <ResourceDictionary>
      <logicalModifiers:OrModifier x:Key="OrModifier" />
      <logicalModifiers:AndModifier x:Key="AndModifier" />
      <comparableModifiers:LessThanModifier x:Key="LessThanModifier" />
      <comparableModifiers:LessThanEqualToModifier x:Key="LessThanEqualToModifier" />
      <comparableModifiers:GreaterThanEqualToModifier x:Key="GreaterThanEqualToModifier" />

      <!-- Similar to how you would add a Converter globally like below -->
      <converters:BooleanToCollapsedConverter x:Key="BooleanToCollapsedConverter" />
    </ResourceDictionary>
  </Application.Resources>

How to use ConnectivityTrigger from AdaptiveTriggerLibrary?

Hi,
I need using ConnectivityTriggers. In view I wrote this code:
xmlns:connectivityTriggers="using:AdaptiveTriggerLibrary.Triggers.ConnectivityTriggers"

    <VisualState x:Name="disconnect">
        <VisualState.StateTriggers>
            <connectivityTriggers:NetworkConnectionStateTrigger
                Condition="ConstrainedInternetAccess"/>
        </VisualState.StateTriggers>
        <VisualState.Setters>
            <Setter
                Target="EditProfileButton.IsEnabled"
                Value="False" />
        </VisualState.Setters>
     </VisualState>
</VisualStateGroup>```
 
And this code not work. 
What I need write to ConditionModifier?

Target 1903

I tried this library with Target 1903 SDK.
but Something wrong.. I could not run.
Do you know reason ?

there is some error like.
NU1201 AdaptiveTriggerLibraryuap10.0.10240 (UAP,Version=v10.0.10240) not compatible with .net uap10.0.18362 (UAP,Version=v10.0.18362)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.