BleLab | Bluetooth LE Lab - UWP application | Runtime Evironment library
kandi X-RAY | BleLab Summary
kandi X-RAY | BleLab Summary
Bluetooth LE Lab - UWP application for interaction with BLE GATT devices
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BleLab
BleLab Key Features
BleLab Examples and Code Snippets
Community Discussions
Trending Discussions on BleLab
QUESTION
I'd like to import an extern function of Win32API.
The Code from the API (in C) looks like this:
...ANSWER
Answered 2017-Aug-09 at 11:02There's really no point in trying to declare this as a union. It's an unsigned 64 bit type. Just use ulong
instead of the struct.
If you never need to display the address, then you would need to pick out just the first 6 bytes of that ulong
. A Bluetooth address is a 48 bit value, hence 6 bytes.
But for your purposes there's nothing to be gained by trying to express that nuance in the type used for interop. Which is why I would recommend working with ulong
for the interop and picking out the meaningful bytes if necessary as a separate action.
QUESTION
I started to learn Caliburn.Micro with UWP. first, I found a good example at here. https://github.com/IanSavchenko/BleLab ( Thank you, Ian )
This application has BumbugerMenu + Caliburn.Micro. in this project, BumbergerMenu root is "Main". and Sub menu is "About","Setting","Device". My Quesiton is .. How to write "ViewModel" as Normal.
First is "MainViewModels" The class is extend with "Conductor"
sub Menu "AboutViewModel" The class is extend iwth "PropertyChangedBase"
sub Menu "DeviceViewModel" The class is extend with Conductor, IHandle
Q1 : When should I use "Conductor" instead of "PropertyChangedBase"
Q2 : in MainViewModel, Why can the class "MainViewModel" expect this arguments when initialize ? I read manual of Caliburn.Micro, but I can not understand why..
...ANSWER
Answered 2017-Jul-25 at 07:57For your first question:
PropertyChangedBase – Implements INotifyPropertyChangedEx (and thus INotifyPropertyChanged). It provides a lambda-based NotifyOfPropertyChange method in addition to the standard string mechanism, enabling strongly-typed change notification. Also, all property change events are automatically marshaled to the UI thread.2
In Caliburn.Micro, this role is represented by the IConductor interface which has the following members: ActivateItem – Call this method to activate a particular item. It will also add it to the currently conducted items if the conductor is using a “screen collection.” DeactivateItem – Call this method to deactivate a particular item. The second parameter indicates whether the item should also be closed. If so, it will also remove it from the currently conducted items if the conductor is using a “screen collection.” ActivationProcessed – Raised when the conductor has processed the activation of an item. It indicates whether or not the activation was successful.3 GetChildren– Call this method to return a list of all the items that the conductor is tracking. If the conductor is using a “screen collection,” this returns all the “screens,” otherwise this only returns ActiveItem. (From the IParent interface) INotifyPropertyChangedEx – This interface is composed into IConductor.
So basically the most important part is that the Conductor allows you to load a specific view, at a specific time (navigation/view injection). Source of the quotes: https://caliburnmicro.codeplex.com/wikipage?title=Screens,%20Conductors%20and%20Composition
Regarding your second question:
The constructor of MainViewModel requires the instances of the VMs from IoC so that the navigation can be performed by the Conductor through ActivateItem( as stated in my aswer from Q1). And regarding the part with "DeviceModel constructor has different arguments"...that is natural; every VM has specific responsibilities and in order to be able to fulfill them it needs specific objects.
Hope this helps. If you have any other questions I'll do my best to address them.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BleLab
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page